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
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3315753-10.patch | 1.75 KB | alexpott |
| #9 | 3315753-9.patch | 1.25 KB | alexpott |
| #8 | 3315753-8.patch | 4.32 KB | alexpott |
| #6 | 3315753-6.patch | 4.54 KB | alexpott |
| #4 | 3315753-4.patch | 4.21 KB | alexpott |
Comments
Comment #2
alexpottComment #4
alexpottComment #6
alexpottComment #8
alexpottComment #9
alexpottSo #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.
Comment #10
alexpottHere's an even better series of asserts that also prove the widget has been updated correctly.
Comment #11
spokje- Explanation in #9 makes sense
- Code changes to avoid the race make sense
If TestBot agrees, I'll RTBC #10.
Comment #12
alexpottI'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!