Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
phpunit
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Oct 2022 at 12:19 UTC
Updated:
27 Oct 2022 at 20:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottComment #5
alexpottAdding upstream related issues to the summary. This pretty clearly a cause of random fails.
Comment #6
alexpottHere's a patch which complies with our coding standards. Let's see what happens with the rest of the test suite.
Comment #7
alexpottFixing capitalisation issue.
Comment #8
alexpotthttps://github.com/minkphp/MinkSelenium2Driver/pull/333 might also be relevant...
Comment #11
quietone commentedNone of the failures in #6 and #7 are the one that is from the fail test in #2, which is
WebDriver\Exception\CurlExec: Curl error thrown for http POST to http://chromedriver-jenkins-drupal8-core-regression-tests-68651:9515/session/e035c0c985e1fc0be9662b63581124c9/execute with params: {"script":"(function (element) {\n var event = document.createEvent(\"HTMLEvents\");\n\n event.initEvent(\"drop\", true, true);\n event.dataTransfer = {};\n\n element.dispatchEvent(event);\n}(arguments[0]));","args":[{"ELEMENT":"0.5203560764679722-5"}]}Based on that evidence I'd like to see this in. Should the test in #2 run more that 50 times?
Comment #12
alexpottI think the evidence in #2 is quite clear that this is a source of random fails. Given it fails consistently without the code and consistently passes with. I don't think upping the 50 is going to show us much given the fail rate.
I think the big question for this issue is correctness. I guess what we should add is a dragTo test and confirm that on DrupalCI these events are still triggered.
Comment #13
spokjeI'm all about correctness, but doesn't the fact that test using
dragToconsistently fail without the patch and pass with the patch already prove that the patch-version ofdragTois triggering?Also, since TestBot is failing all over the place lately, making testing not so much fun and causing extra test-cycles to be used, can the above mentioned test be done in a follow-up to get this one in quickly?
Putting on RTBC for the above reasoning. Happy to corrected :)
Comment #14
longwaveRTBC+1, these random fails are really hard to reproduce outside of DrupalCI and we don't have enough visibility into DrupalCI to figure out what is going wrong, so for now let's get this in and hopefully resolve some of the weird random failures we have seen this week.
Comment #15
alexpottMy concern is that the dragstart and drop events are not being triggered anymore. Otherwise why does the upstream code exist? That's why I think we should add a test that proves these events are being triggered on our test system so at least we know that things have not changed there. Maybe no core test relies on these being triggered but maybe something in contrib or custom does?
Comment #16
longwavehttps://github.com/minkphp/MinkSelenium2Driver/pull/75 was rejected but we could just add the method with a different name to our own driver?
Comment #17
longwaveA comment from 2014 that still applies today:
https://github.com/minkphp/MinkSelenium2Driver/issues/51#issuecomment-31...
It seems possible that we have both native and synthetic events being fired - and that could be the cause of some random fails? Especially given the async nature of JavaScript, if some events fire twice, and sometimes in an unexpected order, this could cause undefined/non-deterministic behaviour?
Comment #18
alexpottLooking at fails like https://www.drupal.org/pift-ci-job/2498577 - the dragTo related fails are the stale element ones. The lines of code that causes this are:
in \Behat\Mink\Driver\Selenium2Driver::dragTo().
I think we can do something a bit more defensive here. That will hopefully get us round the randoms without changing things too much.
Comment #19
alexpottComment #20
alexpottIf #19 is good here is the patch to commit.
Comment #22
longwaveI like the new approach as it's even less of a BC break than before. Still not even sure we need to fire those synthetic events, but this works around the issue in a better way. The results in #19 are great so to me #20 is RTBC.
Comment #23
spokjeCross-post RTBC (now +1)
Comment #24
quietone commentedThis isn't needed anymore.
Comment #25
spokjeNightowl @quietone proving her nightvision there...
Comment #27
spokjeSo I think I got very lucky with the testrun in #25, but the testrun in #20 is also without any of the
WebDriver\Exception\CurlExec: Curl error thrown for http POSTexceptions.Putting back to NR, since changes were made since the last RTBC, but I think this is one less annoying random-test-failure.
Comment #28
alexpottThe changes from #20 to #25 are only extraneous comment removal. The original RTBCs still stand.
Comment #33
lauriiiCommitted 4b98aae and pushed to 10.1.x. Also cherry-picked all the way down to 9.4.x hoping tests are a bit more stable as a result of this. Thanks!
Comment #34
quietone commentedI looked at the test runs for 9.4, 9.5, 10.0 and 10.1 after this commit and there is only once instance of this particular failure. It is on 9.4.x. That is a huge improvement. Thanks!
https://www.drupal.org/pift-ci-job/2498743 Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::testRemove,