After

#2943184: Test instability - Random fails.

I was refactoring FlagBookmarkUITest as it was giving repeatability issues #2764709: [Regression/Refactor] Restore Ajax link type "flag message" functionality

Now I find in that issue

#2944815: Update FlagBookmarkUITest

this

https://www.drupal.org/pift-ci-job/890024

It looks like LinkTypeAjaxTest is wonky. The only way is to work through these problems as we find them

CommentFileSizeAuthor
#4 2945195-4.patch1.07 KBmartin107

Comments

martin107 created an issue. See original summary.

martin107’s picture

Found a second example of test failures, for no apparent cause.

here is breakdown of the problem, with the test artifacts

https://www.drupal.org/project/flag/issues/2945772#comment-12495283

https://www.drupal.org/pift-ci-job/893140

martin107’s picture

I have found a clue in a ... to a least one instability in the system

This test run
https://www.drupal.org/pift-ci-job/913468
from this issue/patch/comment
https://www.drupal.org/project/flag/issues/2842386#comment-12526121

The expected and observed strings differ in ONLY the last position which is a White space....

I think we can hunt down the problem from here...


Flag.Drupal\Tests\flag\FunctionalJavascript\AjaxLinkTest
✗
Drupal\Tests\flag\FunctionalJavascript\AjaxLinkTest
fail: [Other] Line 0 of sites/default/files/simpletest/phpunit-2.xml:
PHPunit Test failed to complete; Error: PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

Testing Drupal\Tests\flag\FunctionalJavascript\AjaxLinkTest
F

Time: 47.23 seconds, Memory: 3.50MB

There was 1 failure:

1) Drupal\Tests\flag\FunctionalJavascript\AjaxLinkTest::testDomUpdate
DOM update: The flag message is flashed.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'ep|wzIG~5nnFB%d*zh7gT0.&Q+`]+C] '
+'ep|wzIG~5nnFB%d*zh7gT0.&Q+`]+C]'

/var/www/html/core/tests/Drupal/Tests/BrowserTestBase.php:1286
/var/www/html/modules/contrib/flag/tests/src/FunctionalJavascript/AjaxLinkTest.php:120

FAILURES!
Tests: 1, Assertions: 11, Failures: 1.

martin107’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

#3 has convinced me that we need an additional constraint to our pseudo random string.

This patch strips out white spaces and so will fix a class of apparently random test failures.

I think this patch is ready to commit.

socketwench’s picture

Status: Needs review » Reviewed & tested by the community

Huh. Didn't expect that.

  • socketwench committed 363e210 on 8.x-4.x authored by martin107
    Issue #2945195 by martin107, socketwench: Fixed test instability ( round...
socketwench’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, Martin!

Status: Fixed » Closed (fixed)

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