Problem/Motivation
https://git.drupalcode.org/issue/drupal-3583486/-/jobs/11292797#L539
✘ Full html
┐
├ Behat\Mink\Exception\ExpectationException: The string "⬅️✌️➡️NASA is an acronym." was not found anywhere in the HTML response of the current page.
│
│ /builds/vendor/behat/mink/src/WebAssert.php:888
│ /builds/vendor/behat/mink/src/WebAssert.php:363
│ /builds/core/tests/Drupal/Tests/WebAssert.php:569
│ /builds/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5AllowedTagsTest.php:466
┴Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3614519
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:
- 3614519-random-test-failure
changes, plain diff MR !16522
Comments
Comment #4
velmir_taky commentedhttps://git.drupalcode.org/issue/drupal-3614519/-/jobs/11300551
Comment #5
smustgrave commentedCan you post stats like others do https://www.drupal.org/project/drupal/issues/3614445
Comment #6
velmir_taky commentedReproduced locally -
testFullHtmlis quite racy on a fast box (~7/8 runs failed for me), and not only at line 466.Root cause: saving the node is a plain form submit that redirects to the rendered entity. That navigation isn't tracked by
assertWaitOnAjaxRequest(), and nothing waits for it, so the next step runs against the wrong page. It shows up in two ways:- the
responseContains()right after a save reads the still-open edit page (the reported line 466), and- the
drupalGet('...manage/full_html')after the first save loses the race to the save redirect - the browser ends up back on the node instead, soroles[authenticated]isn't found. Confirmed from the browser output (page was "My test content", not the format form).There's already a
waitForText('NASA is an acronym.')after one of the saves, so the pattern was there - I just applied it to every node save in the test and pulled it into a smallsaveNodeAndWait()helper so the wait isn't copy-pasted. The first save renders via Plain Text (tags escaped), so it waits on the title instead.Stats (local,
testFullHtmlrun in a loop, same box):Before (current
main):After (this MR):
Comment #7
smustgrave commentedThank you for providing that :) Stats LGTM.
Comment #8
catchI think it would be clearer to have the ::waitForText() calls inline (as is the case with one call that was replaced by the helper).
Comment #9
velmir_taky commentedInlined the waitForText() calls and dropped the helper, thanks.
Comment #10
catchThanks I think that looks good now.
Comment #11
godotislateRan the repeat test, set for 1000: https://git.drupalcode.org/issue/drupal-3614519/-/jobs/11325976
The job exceeded the 30min limit after ~500 times, and in that period, the test failed once. Since the job timed out, there's no have any report about the test failure though.
Comment #14
catchSince this is failing a lot more than that currently, let's get this in, but might need to open an new issue if it keeps failing 1/500 times.
Committed/pushed to main and 11.x, thanks!
Comment #16
kentr commentedThere's another failure in the same test, but it looked like a different problem to me: #3616199: [random test failure] CKEditor5AllowedTagsTest::testFullHtml