Problem/Motivation

Drupal\Tests\media_library\FunctionalJavascript\WidgetUploadTest is randomly failing at the moment. The fail is:

Testing Drupal\Tests\media_library\FunctionalJavascript\WidgetUploadTest
.F                                                                  2 / 2 (100%)

Time: 06:48.373, Memory: 4.00 MB

There was 1 failure:

1) Drupal\Tests\media_library\FunctionalJavascript\WidgetUploadTest::testWidgetUploadAdvancedUi
"image-1.png" was found but shouldn't be there.
Failed asserting that a boolean is not empty.

/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
/var/www/html/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php:86
/var/www/html/core/modules/media_library/tests/src/FunctionalJavascript/WidgetUploadTest.php:482
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:726

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new2.77 KB

Status: Needs review » Needs work

The last submitted patch, 2: 3315753-2.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new4.21 KB

Status: Needs review » Needs work

The last submitted patch, 4: 3315753-4.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new4.54 KB

Status: Needs review » Needs work

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

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new4.32 KB
alexpott’s picture

StatusFileSize
new1.25 KB

So #8 is the fix because the text is there sometimes! What is happen is that the webdriver requests are so slow on DrupalCI that they don't catch the point between the JS that removes the file and the JS that adds the drupal announce is run. We have a race that we often lose when things are very slow :)

Here's the patch to commit.

alexpott’s picture

StatusFileSize
new1.75 KB

Here's an even better series of asserts that also prove the widget has been updated correctly.

spokje’s picture

Status: Needs review » Reviewed & tested by the community

- Explanation in #9 makes sense
- Code changes to avoid the race make sense

If TestBot agrees, I'll RTBC #10.

alexpott’s picture

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

I'm going to commit this because it is a test only critical that makes the testing system more stable.

Committed and pushed dcc4424336 to 10.1.x and cb8db5e3e0 to 10.0.x and 68e1b87fc9 to 9.5.x and f47f3c01bf to 9.4.x. Thanks!

  • alexpott committed dcc4424 on 10.1.x
    Issue #3315753 by alexpott: Random fail in Drupal\Tests\media_library\...

  • alexpott committed cb8db5e on 10.0.x
    Issue #3315753 by alexpott: Random fail in Drupal\Tests\media_library\...

  • alexpott committed 68e1b87 on 9.5.x
    Issue #3315753 by alexpott: Random fail in Drupal\Tests\media_library\...

  • alexpott committed f47f3c0 on 9.4.x
    Issue #3315753 by alexpott: Random fail in Drupal\Tests\media_library\...

Status: Fixed » Closed (fixed)

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