Problem/Motivation
#3037436: [random test failure] Make QuickEditIntegrationTest more robust and fail proof and #3066447: [random test failure] Random failures building media library form after uploading image (WidgetUploadTest) amongst others are wasting contributor time as they knock RTBC patches back to Needs Work, when in fact it was just a random test failure. These failures are false positives and always go away on a retest.
Steps to reproduce
Mark a patch RTBC and wait a few days/weeks for a random test failure.
Proposed resolution
Provide a way of marking a test as "flaky". If a flaky test fails, automatically repeat it in the test run and only actually fail if it fails the second time round.
Remaining tasks
Decide if this is a good idea.
Figure out how to implement it.
Comments
Comment #2
jhodgdonIf a test is that flaky (and I personally have seen multiple failures on RTBC patches for that QuickEditIntegrationTest), I think the best thing to do would be to remove it from the code base as soon as it's identified as a major annoyance, and then have an issue that adds it back in once it has been fixed.
Comment #3
jonathanshawThis is what I have in my project:
Comment #4
mondrakeDelightfully lovely :) and so true.
+1 on the idea of this patch.
Comment #5
alexpottThis seems pragmatic. I think there should always be an issue open to remove it and it should be a matter of last resort. But the random fails in the JS tests have prove intractable for some reason.
Comment #6
catchWith issues like #3037436: [random test failure] Make QuickEditIntegrationTest more robust and fail proof I think we should have been marking those as skipped (leaving the code there) with issues to diagnose and re-enable them, but there's a question as to why we haven't done that, so we should definitely at least discuss this option instead.
Comment #13
mondrakeIn PHPUnit upstream, this is being proposed in #[Retry] attribute to support retrying flaky test #6182
Comment #14
mondrakeComment #15
mondrakeI suggest to continue in #3564900: Let run-tests.sh re-run flaky test classes on failure as now the overall context changed, and in fact the situation deteriorated quite a lot.