Repository navigation
chore: Start the database for the test of an interrupted write outside the timeout of CancellationTest, so that a slow Docker does not break all container tests. - #3
Merged
Conversation
…e the timeout of CancellationTest, so that a slow Docker does not break all container tests. CancellationTest gives each test 10 seconds, and the test of a write whose thread is interrupted started its container within that time. When Docker was slow to answer, e.g. right after Docker Desktop resumed, the timeout interrupted Testcontainers while it was looking for Docker. Testcontainers then never tries again, so every later test that needed a container failed with "Previous attempts to find a Docker environment failed. Will not retry." The test now lives in WriteEventsTest, which starts the database in @beforeeach, and the timeout of a class does not cover that. With the timeout of CancellationTest cut to 2 seconds, the test failed before, and all tests pass now. A comment in CancellationTest says why its timeout must not cover starting a container. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz
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.
A local
make qafailed with 62 of 149 tests at once. The first one wasaWriteOfAnInterruptedThreadWritesNothing, which timed out after 10 seconds. All others failed with:Why:
CancellationTestgives each test 10 seconds, and this test started its container within that time.What changes:
WriteEventsTestaswritesNothingIfTheThreadIsInterrupted. That class starts the database in@BeforeEach, and the timeout of a class does not cover lifecycle methods. I checked that by cutting the timeout ofObserveEventsTestto one second, below the start time of a container, and its test still passed.CancellationTestsays why its timeout must not cover starting a container.CancellationTestuse a fake server, and stay as they are.Tests:
CancellationTestcut to 2 seconds, the test failed on main, and all tests pass on this branch.make qais green, and coverage stays at 100 %.A second flaky failure came up in the same runs: a container whose database did not become reachable within 10 seconds, as in Go #188. That needs a change to
Container, so it gets a PR of its own.🤖 Generated with Claude Code
https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz