Skip to content

feat: add automatic health check wait option to ContainerGuard #223

@joshrotenberg

Description

@joshrotenberg

Summary

Add a builder option to automatically wait for the container to be ready before returning from start().

Current API

let guard = ContainerGuard::new(template).start().await?;
guard.template().wait_for_ready().await?;  // separate call required

Proposed API

let guard = ContainerGuard::new(template)
    .auto_wait_ready(true)  // or .wait_on_start(true)
    .start()
    .await?;
// Container is guaranteed ready at this point

Benefits

  • Single call for "give me a ready container"
  • Reduces boilerplate in tests
  • Can still disable for cases where you don't need to wait

Considerations

  • Should this be the default behavior? (breaking change if so)
  • Timeout configuration for the wait
  • Error handling if readiness check fails

Related to #218 (wait_for_ready convenience method)

Part of testing utilities enhancements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions