Repository navigation
chore: Wait for the background removal in the test of a container that Docker creates late, instead of polling for a fixed time. - #427
Merged
Conversation
…t Docker creates late, instead of polling for a fixed time. The test held the creations back until the start had failed, and then polled for 5 seconds for the containers to disappear, while their removal only runs once testcontainers gives up on them, which may take longer under load. Now the test lets Docker create the containers only after the start has failed, and awaits the removals in the background through a test-only hook of startContainer. The watcher of created containers no longer assumes that Docker's events have arrived by the time the start returns: it creates a marker container and waits for its event, after which all earlier events have arrived. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QykegdHe7vhHMBN3kWxgfH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a flaky test from #425, "removes a container that Docker creates only after the wait…", which failed once on preview.
startContainerhands the background removal to a test-onlyonBackgroundRemovalhook, and the test awaits it before checking that nothing is left.The test passed 20 times in a row, 10 times with every core busy (load average up to 55), and the whole file twice under that load. Breaking the background removal or the cap still fails it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QykegdHe7vhHMBN3kWxgfH