Skip to content

feat: add wait_for_ready() method and builder option to ContainerGuard#225

Merged
joshrotenberg merged 1 commit intomainfrom
feat/container-guard-wait-ready
Jan 5, 2026
Merged

feat: add wait_for_ready() method and builder option to ContainerGuard#225
joshrotenberg merged 1 commit intomainfrom
feat/container-guard-wait-ready

Conversation

@joshrotenberg
Copy link
Copy Markdown
Owner

Summary

Implements #218. Adds convenience method and builder option to ContainerGuard.

Changes

New Methods

wait_for_ready() on ContainerGuard:

let guard = ContainerGuard::new(template).start().await?;
guard.wait_for_ready().await?;  // Convenience method

New Builder Option

wait_for_ready(bool) builder method:

let guard = ContainerGuard::new(template)
    .wait_for_ready(true)  // Automatically wait after start
    .start()
    .await?;
// Container is guaranteed ready at this point

Behavior

  • The builder option makes start() block until the container passes its readiness check
  • Works for both new and reused containers (when reuse_if_running is enabled)
  • Delegates to the underlying template's wait_for_ready() implementation

Testing

  • Added 2 new integration tests
  • Updated unit tests for the new option
  • All 762 existing tests continue to pass

Closes #218

- Add wait_for_ready() convenience method on ContainerGuard that
  delegates to the underlying template's readiness check
- Add wait_for_ready builder option to automatically wait during start()
- Works for both new and reused containers

Closes #218
@joshrotenberg joshrotenberg merged commit f497dd2 into main Jan 5, 2026
11 checks passed
@joshrotenberg joshrotenberg deleted the feat/container-guard-wait-ready branch January 5, 2026 23:22
@github-actions github-actions Bot mentioned this pull request Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add wait_for_ready() convenience method to ContainerGuard

1 participant