Needs review
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Oct 2026 at 14:21 UTC
Updated:
26 Nov 2026 at 09:04 UTC
Jump to comment: Most recent
Comments
Comment #2
mondrakeComment #3
longwaveTo me
#[Retry]is the one that makes most sense given we are trying to defend against flaky tests instead of just find them; I can't think of a case where we explicitly want a test to be repeated, we just want it to pass once and as quickly as possible.Does the report include the number of retries somewhere? I was thinking whether we could use it in future to detect which tests to fix, but also I guess we just want to eliminate
#[Retry]entirely where we can.edit: oh yes I see from the docs:
If we could then aggregate these results somehow then perhaps we could identify the most flaky tests that we want to fix first.
Comment #4
mondrake#3 probably makes sense, but
a) the detail of the retried tests is not available on JUnit, only in the text output (maybe in the new OTR output format? to be checked), so it gets swallowed in run-tests.sh detail report
b) if the test eventually succeeds after some failures, we do not get any information on the reason of the failure
OTH, playing around in #3574681: [Nov 2026] Introduce support for PHPUnit 13.5 I found that for not particularly expensive tests,
#[Repeat(3, 2)]could be an interesting compromise https://git.drupalcode.org/project/drupal/-/merge_requests/14840/diffs?f...runt-tests.shdetailed result report every attemptComment #5
longwaveWe can still parse the full logs if we need to, I assume the junit output just doesn't have any fields for anything like this.
I believe most of the flaky tests are JavaScript and none of them are particularly quick so adding repeat feels like it will slow us down there, but I might be wrong.
Comment #6
panchoI would personaly prefer a policy to use
#[Repeat]as I don't think we should primarily defend against flaky tests. Over time, we should fix them, one by one, and my experience with #3631339: [random test failure] FieldTest::testModalDialogTitle fails intermittently tells me that it's possible.Just my two cents, though...
Comment #7
godotislateAgreed with #3: we should use
#[Retry], because our goal for now is defend against flaky tests. Setting tests to repeat regardless of whether they pass uses CI resources we are trying to reduce the bill on.We also already have the repeat test job that we can run manually to help identify flaky tests, or check that they've been addressed.
Comment #8
longwaveComment #9
smustgrave commented+1 to the Retry approach. Can we extend to nightwatch as that's being the PITA right now.
Comment #10
longwaveThe Nightwatch flakes will.hopefully be solved by #3413665: Enable modules through Nightwatch API when not testing module enabling.
Comment #11
mondrake#9 no Nightwatch is not PHPUnit based, this is a PHPUnit thing.
Comment #12
mondrake#9 #11 let's make it clear in the issue title.