- Issue created by @catch
- First commit to issue fork.
- π¦πΊAustralia mstrelan
Here is line 285 in the reported fail: https://git.drupalcode.org/project/drupal/-/blob/e39157a2add904150390232...
Note that
$image_figure
is not null or there would have been an error calling::hasClass
. That means that$assert_session->waitForElementVisible('css', 'figure')
found an element, but it doesn't have the class.I haven't looked at how the class gets added, but perhaps there is a race condition where the figure element is added and the class is added shortly after, but we're finding the figure before the class is added.
I've updated the test to call waitForElementVisible with and without the class depending on the param. This passes the few times I've tested locally, not sure how to ensure it's not flakey.
- πΊπΈUnited States smustgrave
shouldn't it still be assertSame() with $selector.
- π¦πΊAustralia mstrelan
@smustgrave it's not that simple, we'd need to use
hasClass
again like this:$selector = $is_resize_enabled ? 'figure.ck-widget_with-resizer' : 'figure:not(.ck-widget_with-resizer)'; $image_figure = $assert_session->waitForElementVisible('css', $selector); $this->assertNotNull($image_figure); $this->assertSame($is_resize_enabled, $image_figure->hasClass('ck-widget_with-resizer'));
But
waitForElementVisible
will only find elements that match the selector, so not much point asserting it again. - π¦πΊAustralia acbramley
The fix looks good, do we want to spin up a pair of MRs to run the test through a bunch to show the random failures are gone? See π [random test failure] FilterEntityReferenceTest Active for an example (branches are hidden)
- π¦πΊAustralia mstrelan
mstrelan β changed the visibility of the branch 3484845-repeat-1000-no-fix to hidden.
- π¦πΊAustralia mstrelan
mstrelan β changed the visibility of the branch 3484845-repeat-1000-fix to hidden.
- π¦πΊAustralia mstrelan
I stopped these well before reaching 1000
Without the fix it failed 19 times from 119 runs - https://git.drupalcode.org/issue/drupal-3484845/-/jobs/4709283
With the fix it failed 0 times - https://git.drupalcode.org/issue/drupal-3484845/-/jobs/4709305
- π¬π§United Kingdom catch
Committed/pushed to 11.x and cherry-picked to 11.1.x, thanks!
Doesn't cherry-pick to 10.5.x cleanly so leaving fixed against 11.1 for now.
Automatically closed - issue fixed for 2 weeks with no activity.