testcontainers / testcontainers/testcontainers-java
`FAIL_FAST_ALWAYS` for selection of `DockerClientProviderStrategy` not reset in flaky environments when tests are retried
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Hello team!
Please provide ability to disable FAIL_FAST_ALWAYS usage for the selection of DockerClientProviderStrategy located here: https://github.com/testcontainers/testcontainers-java/blob/abf18468c2b3c8ec395f07fe91cd3afd449e28d2/core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java#L55
Our use case:
- We have big mono repo which periodically execute "test all" kind of job
- This job running gradle tests in parallel (via gradle settings) and a lot of projects using test containers to perform various tests
- Possibly due to the high usage of docker (this part hard to investigate well for me) sometimes test containers will not be able to find docker environment even though it's present and will set flag FAIL_FAST_ALWAYS
- As we use following plugin https://github.com/gradle/test-retry-gradle-plugin that retry tests as part of the same task I assume that initialized static field is not reset when it retry failed tests. So this plugin trying to retry test from the same task for test that uses test containers and it will fail due to FAIL_FAST_ALWAYS flag be set
Having ability to disable this flag on demand or being able to forcibly configure retries even if that flag is set would be helpful in our situation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at core/src/main/java/org/testcontainers/dockerclient/DockerClientProviderStrategy.java around line 55 and trace how FAIL_FAST_ALWAYS is set and checked during Docker environment selection. Reproduce the retry scenario with the Gradle test-retry-gradle-plugin; done means callers can disable the flag or force retries without breaking normal fail-fast behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devops, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100