Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
phpunit
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2022 at 21:24 UTC
Updated:
2 Nov 2022 at 14:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottLet's cause it fail all the time...
Comment #4
alexpottComment #6
alexpottLet's get a screenshot of what happens
Comment #8
alexpottComment #10
alexpottComment #11
alexpottComment #13
alexpottLet's get more info...
Comment #15
alexpottComment #17
alexpottComment #19
alexpottSo the problem is that for some reason clicking on the remove button in replaceFileInBlock doesn't work...
Comment #20
alexpottBorrowing code from \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::removeInlineBlockFromLayout() which also clicks a remove button in off canvas after opening the setting tray.
Comment #21
alexpottAnother one done.
Comment #22
alexpottLet's use the local variable. Makes no difference to the fix.
Comment #23
alexpottInteresting fail on postgres - so #20 does not 100% fix the issue but it does help in 349/350 instances... Maybe this is good enough to commit here and open a follow-up to make better?
Comment #26
wim leersRemoves one excess "wait on AJAX request" and just waits for the button to be pressed to appear. Makes sense.
This one looks more suspicious: we're waiting for something even though we didn't do anything here, so why wait?
Unless this is a helper method that should always be called after waiting for an AJAX response maybe?
Hah, #23 seems to confirm this.
What would IMHO help here is to use something like
\Drupal\Tests\ckeditor5\FunctionalJavascript\AdminUiTest::getAjaxResponseCount()— that would make these tests deterministic in terms of how many AJAX responses should've been processed at every point. Right now, the code is just sprinkled withassertWaitOnAjaxRequest()at both necessary and unnecessary times; it's both waiting too much and too little, which is why it's so sensitive to timing problems.Opened #3316274: Stabilize FunctionalJavascript testing AJAX: add ::assertExpectedAjaxRequest() for that.
I agree with
🚢
P.S.: ironically, the failures in #21 and #22 are in
Drupal\FunctionalJavascriptTests\Tests\JSWebAssertTest, 100% unrelated to this patch :PComment #27
catchCommitted/pushed to 10.1.x, cherry-picked back through to 9.4.x, thanks!
Comment #29
catch