-
Notifications
You must be signed in to change notification settings - Fork 51
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
Ability to rerun a specific test N times or until failure #29
Comments
@rieske Open to more concrete suggestions on how such a thing should work, since a plugin can't add a new top-level flag to the Gradle CLI. Would running a specific task like |
@jkschneider note that plugins can declare CLI options this way starting in Gradle 4-dot-something: https://docs.gradle.org/current/userguide/custom_tasks.html#sec:declaring_and_using_command_line_options We would need to create a separate task to run N times or until failure and we could make CLI flags to configure it. |
@eriwen So do you think |
@jkschneider I think these are some use cases worth supporting:
Silly question: can we leverage Gradle's Can you think of other use cases? If not, perhaps |
Task extensions can't currently do this. Only the implementation class is introspected. So, we could not do this for any released Gradle version. I think there are several good feature ideas raised here, but I think we can wait until this functionality is implemented in Gradle. |
+100000 for retrying given test as long as a result is the same as previous one, but no more than N times. Example: N = 6 x x x x x x-> FAILLNG So as soon as flakyness is detected - stop. It would be cool to have this done by this plugin. |
..or at least do not stop retrying on failing ones. |
This is going to be awkward to do from this plugin. Having this in Gradle itself would provide a much better experience. In particular, it could support invocation time setting such as…
I have raised gradle/gradle#15179 for this. |
The Maven plugin for IntelliJ has had this for a very long time. Keep up, Gradle! |
This would be great to test for flaky tests in the newer Android Studio builds. |
Sometimes, when developing, I expect some test might be flaky due to a code defect - especially when working with concurrent code. Such tests pass most of the time, masking a problem.
When I have such suspect, I end up rerunning that test manually until I get the failure from where I can explore further.
Other times, the failure can be tricky to expose and might take quite a few retries and can easily be missed.
IntelliJ IDEA has a handy feature in their JUnit test runner that I find extremely useful in such cases during development: retry until failure, until stopped or N times.
This is a great help to catch such rarely-failing-because-of-defect suspects by allowing them to run hands-off for a while and only get disturbed when they fail.
Gradle test runner does not expose such ability.
Since
test-retry-gradle-plugin
deals with retrying flaky tests that failed (false negatives), perhaps it could also provide an aid for dealing with potential false-positive flakiness?Alternatively, or in addition to, perhaps Gradle could expose APIs in both CLI and TAPI to run potentially filtered out tests in a specific task until-failure or ntimes -
./gradlew test --tests "..." --until-failure
.The text was updated successfully, but these errors were encountered: