Problem/Motivation
https://git.drupalcode.org/issue/drupal-2921627/-/jobs/7892732#L479
Media (Drupal\Tests\ckeditor5\FunctionalJavascript\Media) ✔ Drupal media ✔ Media arbitrary html ✔ Alt disabled ✘ Translation alt ┐ ├ Behat\Mink\Exception\ElementNotFoundException: Element matching xpath "//img[contains(@alt, "Zartan est le chef des Dreadnoks.")]" not found. │ │ /builds/issue/drupal-2921627/vendor/behat/mink/src/WebAssert.php:465 │ /builds/issue/drupal-2921627/core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php:585 ┴ ✔ Drupal media style in dropdown ✔ Drupal media style with class ✔ View mode with with·alignment ✔ View mode with without·alignment FAILURES! Tests: 8, Assertions: 315, Failures: 1.
Steps to reproduce
Baseline MR with only a comment change:
https://git.drupalcode.org/project/drupal/-/merge_requests/14331
- Repeat
Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest100x: https://git.drupalcode.org/issue/drupal-3566844/-/jobs/7981545 (pass 100/100) - Repeat
Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest300x: https://git.drupalcode.org/issue/drupal-3566844/-/jobs/7981783 (pass 250/250 - timed out after 30 minutes) - Repeat
Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest200x: https://git.drupalcode.org/issue/drupal-3566844/-/jobs/7982078 (failed 2/200)
Proposed resolution
Use waitForElement() instead of directly calling elementExists() after pressButton().
https://git.drupalcode.org/project/drupal/-/merge_requests/14332
- Repeat
Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest100x: https://git.drupalcode.org/issue/drupal-3566844/-/jobs/7981655 (pass 100/100) - Repeat
Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest300x: https://git.drupalcode.org/issue/drupal-3566844/-/jobs/7981784 (pass 254/254 - timed out after 30 minutes) - Repeat
Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest200x: https://git.drupalcode.org/issue/drupal-3566844/-/jobs/7982115 (pass 200/200)
Remaining tasks
Verify results of baseline vs. fix repeat jobs- Reviews / refinements
- RTBC
- Commit / rejoice
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3566844
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dwwWorking on it...
Comment #6
dwwMRs open. Repeat jobs running. Leaving NW until the repeat results are done and I can update the summary accordingly.
Comment #7
dwwFirst set of repeat jobs (100x) passed on both MRs. Trying again at 300x to try to get the random fail to fail.
Comment #8
dww300x is too many, this test takes so long, that timed out after around 250 runs in both MRs. Trying again to trigger failures, this time with a pair of 200x runs.
Comment #9
dwwPhew, 3rd time was the charm. Finally caught the baseline red handed with 2 fails out of 200:
https://git.drupalcode.org/issue/drupal-3566844/-/jobs/7982078
Ready for review.
Comment #10
mstrelan commentedThe change looks good and the format of the assertion matches what we're doing before the save button is pressed. The only observation I'll make is that the baseline passed 548/550 runs and the fix passed 554/554. The margin of error is so slim that it's entirely possible this is only passing with a bit of luck, but I don't think this is the case here.
Comment #11
dwwThanks!
Happy to do more repeat runs to see if the ratio improves and to confirm the fix never fails. Not sure it's worth the CO2 and $.
Comment #14
catchThere have been some random failures where it was a really strange race condition and repeat runs showed we didn't actually fix it, but so many random failures in js tests are due to not waiting for an element to appear I think we can just go ahead here.
Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!