Problem/Motivation
\Drupal\FunctionalJavascriptTests\JSWebAssert::waitForHelper() catches \WebDriver\Exception\CurlExec and will retry when this occurs. There are situations however when an exception occurs while doing a waitForText() when a different exception will be thrown and we should probably retry.
ON a client project I'm seeing a lot of
WebDriver\Exception\NoSuchElement: Element not found with xpath, //html
no such element: Unable to locate element:
{"method":"xpath","selector":"//html"}
(Session info: headless chrome=89.0.4389.114)
(Driver info: chromedriver=89.0.4389.23
(61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294}),platform=Linux
5.4.0-1049-aws x86_64)
This tends to occur when the CI server is under load.
Steps to reproduce
Proposed resolution
Catch WebDriver\Exception\NoSuchElement and continue to wait.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3246152-9.5.x-10.patch | 726 bytes | alexpott |
| #3 | 3246152-3.patch | 764 bytes | alexpott |
| #2 | 3246152-2.patch | 872 bytes | alexpott |
Comments
Comment #2
alexpottComment #3
alexpottRerolled.
Comment #4
vijaycs85Definitely, this would allow covering other failed cases and additional retry.
Comment #8
smustgrave commentedPatch or MR doesn't apply anymore
The last patch or MR doesn't apply to the target branch, please reroll the code so that it can be reviewed by the automated testbot.
Comment #9
smustgrave commented@alexpott
Was this resolved in #3315227: Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest is failing a lot at the moment?
If so can we close this as outdated or duplicate and move over credit.
Comment #10
alexpott@smustgrave nope we just moved the code in that one... moving back to 9.5.x as this is a bug.
Comment #12
smustgrave commentedThank you @alexpott for the follow up.
#11 appeared to be a random failure. Reran again with no issues.
Not sure if this will need tests will let the committer decide.
Comment #13
alexpottRe tests - this one is very very hard to test.
Comment #17
xjmOh, this is excellent. I've seen this on DrupalCI as well and hopefully fixing it will reduce our random fail rate.
Committed to 10.1.x, and cherry-picked to 10.0.x and 9.5.x. Thanks!
Comment #18
xjm