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.
Problem/Motivation
#2901792: Disable all animations in Javascript testing fixed a lot of random JS fails but we still have one in \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderDisableInteractionsTest::testFormsLinksDisabled
See https://www.drupal.org/pift-ci-job/1298341
Proposed resolution
Work out what's going on.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#28 | 3056536-3-28.patch | 5.17 KB | alexpott |
#28 | 27-28-interdiff.txt | 1.61 KB | alexpott |
#27 | 3056536-3-27.patch | 6.33 KB | alexpott |
#27 | 23-27-interdiff.txt | 1.47 KB | alexpott |
#26 | 3056536-23.patch | 7.88 KB | alexpott |
Comments
Comment #2
alexpottLet's try to see what's happening.
Comment #3
alexpottComment #4
alexpottComment #5
alexpottSo looking at https://dispatcher.drupalci.org/job/drupal_patches/99033/artifact/jenkin... it doesn't look like the iFrame thing :(
What really interesting is that I can't get this test to pass locally at all. I fail with
Which is a different fail to the random one AND it's not random - it fails every time.
Comment #6
Wim LeersSame here:
Comment #7
alexpottSo here's a fix for the local fail so at least this passes for me.
What's weird is how does
\WebDriver\Exception::factory()
generate an \WebDriver\Exception\UnknownError on DrupalCI and not locally. If I had to guess this is because the error code is different.Comment #9
alexpottAfter talking to @tedbow we're trying the new assert from #2892440: Provide helper test method to wait for an element to be removed from the page - I don't see why this should work because the screenshots show the settings tray is still active. So I'm hoping this fails.
Comment #10
alexpottSo locally using chromedriver direct we error code is 64. On linux on DrupalCI using chromedriver direct it's 13 and according to @tedbow this test passes locally whilst using selenium-server to connect to chromedriver so that must be returning a 13 too. So the fix to catch the generic \Exception feel fine as we're asserting on the contents of the message - which is the same locally and with DrupalCI.
Comment #11
alexpottWhoops - tested locally but as this doesn't fail locally anymore didn't catch this.
Comment #12
tedbowThe test passes for me locally but I am using selenium
The failure in #5 and #6 is something we have been trying to solve in #3032275: Create a fault-tolerant method for interacting with links and fields in Javascript tests
Comment #14
alexpottLet's a try a very small iframe.
Comment #15
alexpott@tedbow I don't think #5and #6 are related to #3032275: Create a fault-tolerant method for interacting with links and fields in Javascript tests the code here is doing the opposite.
I.e. we want the exception we were just catching the wrong exception.
Comment #16
alexpottOkay boiling this down to the simplest set of changes for locally passing and random fail fixing. Leaving the drupalci.yml changes is atm to prove that this is the fix.
Comment #17
alexpottLet's see if we can change just the width.
Comment #19
alexpottHmmm... maybe we need the extra screen size....interesting,
Comment #21
tedbowSense this issue mentions "cross domain iframe" trying with local iframe. For this test it is not important that it is remote src
Comment #22
alexpottSo let's go back to 1200 width and and making the iframe 1x1 - or maybe #14 was a fluke :( but it seems unlikely.
Comment #23
alexpottSo #14 which all the different fixes is not failing - reuploading with the unnecessary WebdriverTestBase changes.
Comment #24
alexpottSo maybe the page resize is not required...
Comment #26
alexpottBack to #23. For whatever reason this fix seems to need:
Very very weird. Doesn't feel right at all.
Comment #27
alexpottWell it might not feel right but the test is still testing and no longer randomly failing. I'd be in favour of committing this and filing a follow-up for more investigation. And obviously we need to push on #2892440: Provide helper test method to wait for an element to be removed from the page too as that's 1/3 of this.
Comment #28
alexpottRemove debug stuff.
Comment #29
Wim Leers💯
💯
Comment #30
alexpottCreated #3056848: Investigate LayoutBuilderDisableInteractionsTest random fails further
Comment #31
catchThis looks great for stopping the bleeding, fine with cleaning things up in a follow-up.