Problem/Motivation

Testing Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTest
...........E.......                                               19 / 19 (100%)

Time: 11:43.216, Memory: 4.00 MB

There was 1 error:

1) Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTest::testAltTextRequired with data set "Unrestricted" (true)
Behat\Mink\Exception\ElementNotFoundException: Element matching css ".ck-balloon-panel_visible .ck-balloon-rotator__content > .ck.ck-text-alternative-form" not found.

/var/www/html/vendor/behat/mink/src/WebAssert.php:418
/var/www/html/core/tests/Drupal/Tests/WebAssert.php:892
/var/www/html/core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php:116
/var/www/html/core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php:440
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:726

in https://www.drupal.org/pift-ci-job/2507415

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Status: Active » Needs review
FileSize
785 bytes
Wim Leers’s picture

I keep forgetting that core/drupalci.yml drives not PHPUnit, but core/scripts/run-tests.sh 😬

Wim Leers’s picture

PHP Fatal error:  Uncaught ReflectionException: Class "Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTest::testAltTextRequired" does not exist in /var/www/html/core/lib/Drupal/Core/Test/TestDiscovery.php:316

… despite

  --class     Run tests identified by specific class names, instead of group names.
              A specific test method can be added, for example,
              'Drupal\book\Tests\BookTest::testBookExport'. This argument must
              be last on the command line.

in the docs 🤷‍♀️

Created #3317504: run-tests.sh claims to support running a particular test method, but does not for that…

Wim Leers’s picture

Alright, so instead of running only the one randomly failing test method, due to lacking infrastructure we'll just have to run all of them 🫥

Status: Needs review » Needs work

The last submitted patch, 6: 3317330-6.patch, failed testing. View results

Wim Leers’s picture

Reproduced locally.

This is a race condition caused by

    $this->addImage();
    $this->assertNotEmpty($assert_session->waitForElementVisible('css', '.ck-widget.image'));

The first uploads an image using \Behat\Mink\Element\NodeElement::attachFile() but doesn't wait for the upload to complete, instead it waits for .ck-widget.image … but this is the THIRD image, so it always matches instantaneously.

core/modules/ckeditor5/js/ckeditor5_plugins/drupalImage/src/imageupload/drupalimageuploadadapter.js uses an AJAX request, we should wait for that … except that it doesn't use the AJAX system. Fortunately, there are other things we can wait for 👍

nod_’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
2.15 KB
528 bytes

Very nice find

catch’s picture

Version: 10.1.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!

  • catch committed 0ba146b on 10.0.x
    Issue #3317330 by Wim Leers, nod_: Random failure in ImageTest::...
  • catch committed e9d3e92 on 10.1.x
    Issue #3317330 by Wim Leers, nod_: Random failure in ImageTest::...
  • catch committed 2934988 on 9.5.x
    Issue #3317330 by Wim Leers, nod_: Random failure in ImageTest::...
catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.