question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`FAIL_FAST_ALWAYS` for selection of `DockerClientProviderStrategy` not reset in flaky environments when tests are retried

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kiviewcommented, Feb 4, 2022

Thanks, this information helps a lot, because this shows it happens on a native Linux Docker installation, rather than Docker Desktop (on Mac or Windows), which would further complicate debugging.

So we might see an overloaded single Docker daemon in your case (which might lead to errors when being pinged).

1reaction
arhont375commented, Feb 3, 2022

One question I forgot to ask you @arhont375, can you describe your setup? Is this happening locally or on CI? How is Docker installed?

This reproducible locally (ubuntu, system installation of docker) and in the CI (Jenkins + CentoOS + system installation of docker).

This may depend on machine that execute it, but following repo allow to reproduce it on my small machine (2 cores, 4 threads, Intel Core i7): https://github.com/arhont375/test-containters-5017 Even if it will not fail for you it may give picture about how tests executed in our environment: parallel execution of projects in gradle + parallel execution of tests via JUnit + many short living tests using containers. PS I added gradle-test-retry plugin there, but somehow not sure if it set up properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >
Test Container test cases are failing due to "Could not find a ...
In my case this error caused by root permission. If you are using ubuntu, docker wants permission to create container and testcontainers can ......
Read more >
Flaky tests - GitLab Docs
Resolution: Fix the previous tests and/or places where the environment is modified, so that it's reset to a pristine test after each test....
Read more >
Manage flaky tests - Azure Pipelines | Microsoft Learn
Improve productivity with flaky test management system. ... even when there are no changes in the source code or execution environment.
Read more >
Stop the Retries in Tests & Reruns of Failing Tests - Applitools
Flaky tests happen because the test conditions fail to occur consistently. Why? Anand Bagmar helps you uncover the root causes of flakiness.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found