gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.03k stars 119 forks source link

Wait before retrying tests via --rerun-failed flag #333

Open yay14 opened 1 year ago

yay14 commented 1 year ago

Is there a feature available to specify a wait time before retrying tests? This feature could potentially help mitigate failures caused by resource contention in services. Implementing an exponential wait time can be particularly effective in such scenarios, reducing the likelihood of failures.

dnephin commented 1 year ago

Hello, thanks for the feature request! There's no way to do that today. Generally the --rerun-fails option is to deal with flaky tests, but I've never encountered a situation where the tests required extra wait time between attempts.

Could you elaborate on the scenario where extra delay would help? If the test is failing to acquire some resource, maybe it could implement some retry before failing?