-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Make tests fail fast #15505
Comments
Thanks @andrross for putting this proposal out. I agree that we should provide a way to fail fast and opt out of it as suggested. Around enabling failFast by default:
|
@mgodwan I believe UNSTABLE means that one of our tests for which retries are enabled failed at least once and then succeeded on a retry. We'd need to confirm that the fail fast behavior doesn't cause the test to immediately fail out unless retries are exhausted. |
Ah! I see. Thanks for the clarification on this :) |
I see some discussion around this here gradle/test-retry-gradle-plugin#75 but don't see any conclusion for supporting both retries and fail fast together. |
Yeah, we need to confirm this behavior before fail fast can be viable option. Also, I am wondering how much time are we going to save in most scenarios. Will it be from 45 min to 10 min, or something like 45 min to 30 min. And, do we need to worry about the increase in resource utilization due to ongoing tasks from prior fail fast? |
I created a draft PR to test this out: #15536 |
Is your feature request related to a problem? Please describe
This is potentially a bad idea, but our test suite takes about 45 minutes or so to complete, and when we encounter flaky failures we retry the whole test run until it passes. While the flaky tests failures are the root cause of the issue, I'm wondering if we can slightly improve the experience by configuring gradle to abort the test run after the first failure is encountered so we can more quickly start the retry.
Describe the solution you'd like
Add the following to build.gradle:
As soon as a failure is encountered, Gradle will stop the currently executing test target, wait for all forked JVMs to complete whatever task they were on, and then exit with a failure. Note that it doesn't abort the concurrently running tasks but it will not execute any tasks that had not yet started.
Related component
Build
Describe alternatives you've considered
Do nothing. There are some downsides here. If your PR introduced multiple failures you'll have to knock them out one-by-one versus getting a single test report with all failures. This will also change the number of data points we're collecting for the test failure metrics since test runs will bail out after a single failure.
Additional context
The fail fast behavior can be overridden on the command line for local tests:
The text was updated successfully, but these errors were encountered: