Drupal\search\Tests\SearchPageTextTest can randomly fail with:

* Drupal\search\Tests\SearchPageTextTest (39 pass(es), 1 fail(s), and 0 exception(s))
   - [fail] [Other] "Raw "Your search used too many AND/OR expressions. Only the first 7 terms were included in this search." found" in SearchPageTextTest.php on line 76 of Drupal\search\Tests\SearchPageTextTest->testSearchText().

This rare random fail is due to:

  $keys[] = $this->randomName(3);

if this generates an "AND" before an OR is added the test fails.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

FileSize
645 bytes

If we increase the length to 4 this can never equal AND and spaces are not allowed in randomName().

xjm’s picture

Status: Needs review » Reviewed & tested by the community

This made me laugh.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Could a use a comment so no-one ever sets that back to 3.

xjm’s picture

Status: Needs work » Needs review
FileSize
724 bytes
676 bytes

Good call.

The last submitted patch, random-and-will-fail.patch, failed testing.

catch’s picture

Status: Needs review » Reviewed & tested by the community
jhodgdon’s picture

Wow, good one! That can't be too common, I would think, but OK.

xjm’s picture

@jhodgdon Well it did cause HEAD to fail this morning. :) 1/(26*36*36) or whatever is small but we have lots of test runs.

jhodgdon’s picture

Indeed.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

  • Commit 41902d3 on 8.x by catch:
    Issue #2246447 by alexpott, xjm: Random failure in Drupal\search\Tests\...

Status: Fixed » Closed (fixed)

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