Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Random fail in \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\ContextualFilterTest::testAddContextualFilterUI
see
https://www.drupal.org/pift-ci-job/646538
https://www.drupal.org/pift-ci-job/650091
https://www.drupal.org/pift-ci-job/655859
https://www.drupal.org/pift-ci-job/729921
It contains 6 assertWaitOnAjaxRequest() calls, so those probably need to be taken out and replaced by some waitForElement calls or something
Occurrence rate seems to be pretty low.
Comment | File | Size | Author |
---|---|---|---|
#18 | x500_2868880-16.patch | 3.77 KB | Anonymous (not verified) |
#16 | 2868880-16.patch | 3.17 KB | Lendude |
#16 | interdiff-2868880-6-16.patch | 522 bytes | Lendude |
#12 | 2868880-baseline-400x.patch | 622 bytes | michielnugter |
| |||
#12 | 2868880-baseline-300x.patch | 622 bytes | michielnugter |
|
Comments
Comment #2
LendudeComment #3
droplet CreditAttribution: droplet commentedIt was a bad style (not recommended) of coding.
assertWaitOnAjaxRequest should be changed to waitForElementVisible (best), or waitForElement.
@see: #2856047: Avoid random failures in JavascriptTestBase when testing functionality in a dialog
Comment #4
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedChecked out the test real quick and I think the problem here is with the dialog and resizing again. We might need to postpone this one on #2856047: Avoid random failures in JavascriptTestBase when testing functionality in a dialog.
EDIT 1: After that get's in we should definitely improve this test on used waiting methods.
EDIT 2: To clarify: wait methods alone are not enough, the buttons will sometimes be visible but move around due to resize events after the visible check passes.
Comment #5
Lendudeadded another failure instance (thanks @mpdonadio)
Comment #6
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedLooked into it a little deeper and found out that it wasn't the dialog that was playing up but it actually was the unreliable assertWaitOnAjaxRequests that we're causing problems.
I converted all to a assertWaitOnAjaxRequest calls to alternatives. I also added the disable for the live preview to prevent errors on saving the view, the button triggered a cancel on the preview ajax request which in turn caused javascript errors.
Comment #7
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedRandom fails in Javascript tests are never novice I think, removing the tags.
Comment #8
droplet CreditAttribution: droplet commentedAll these Views UI JSTests have the same problem. here's one more: https://www.drupal.org/pift-ci-job/661914
Should we sort it in one thread? It should share same code patterns.
Comment #9
Lendude@droplet I like the idea but we should really try to establish a baseline fail rate per test so we are sure that after fixing the test it is really fixed (so hopefully we don't have to go back to it 3 times like this #2870146: Even more random fails in \Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest).
I definitely think we should open up issues for all views ui tests to update them and not wait until somebody opens a 'random fail' issue for it, since we are pretty sure they will fail at some point.
Lets establish a baseline fail rate for this test, first attempt at 100 runs.
Comment #10
LendudeLets crank it up to 200, that should still work.
Comment #11
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedAdded slow and fast configurations for tests to see what that does, might we get a fail this time?
Comment #12
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commented300 and 400 times to see how they hold up.
If this doesn't work I'm going to see if I can trigger the fail some other way..
Comment #15
droplet CreditAttribution: droplet commentedObviously, we fixing the tests, not a non-test bug. Now the failures are predictable basically. Patch like #6 is a good refactoring. In whatever way, we should get it in.
The diff code pattern has diff fail rate. Why not running the patch version 200x ~ 2000x instead and then kick it in and let the wild bots testing it? We need not figure out outdated code failure rate. (Remember that it's never the final code, we will do many code refactoring / additional in the future features...etc)
The only bad thing is our d.org credits increasing so fast :P
Comment #16
LendudeThis is playing up again:
https://www.drupal.org/pift-ci-job/729921
Tiny tweak to the #6 patch, and agree with @droplet lets not worry about fail rates and just get this in.
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commented#12 confirms a random fail. #16 looks logical. But let's check it before RTBC.
Comment #19
Anonymous (not verified) CreditAttribution: Anonymous commented4000 passes (#12 fell twice on this number). So, RTBC with #16. Thanks!
Comment #20
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #24
xjm