testFeedUpdateFields
fail: [Other] Line 49 of core/modules/aggregator/src/Tests/FeedAdminDisplayTest.php:
The non scheduled feed has not been updated. It does not show "x x ago" as last update.

CommentFileSizeAuthor
#5 2861067-5.patch782 bytesAnonymous (not verified)
#3 pseudorandom-2861067-3-fail.patch1.17 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

vaplas created an issue. See original summary.

xjm’s picture

Issue summary: View changes

This also happened in HEAD (last March 11): https://www.drupal.org/pift-ci-job/619499

Anonymous’s picture

Status: Active » Needs review
FileSize
1.17 KB

Aha! What if just the randomMachineName() is generating value with 'ago' from time to time?

The patch reproduces this fail in 49 line :)

Status: Needs review » Needs work

The last submitted patch, 3: pseudorandom-2861067-3-fail.patch, failed testing.

Anonymous’s picture

Status: Needs work » Needs review
FileSize
782 bytes

This code confirms the fact that sometimes this can happen:

$i = 0;
while (++$i) {
  $this->assertSame(FALSE, strpos($this->randomMachineName(10), 'ago'), $i);
}

Quick solution - just override randomMachineName().

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This catch!

  • catch committed 31afc02 on 8.4.x
    Issue #2861067 by vaplas: Random fail in Drupal\aggregator\Tests\...

  • catch committed 679f7ad on 8.3.x
    Issue #2861067 by vaplas: Random fail in Drupal\aggregator\Tests\...
catch’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Fixed
Related issues: +#2571183: Deprecate random() usage in tests to avoid random test failures

Committed/pushed to 8.4.x, and cherry-picked to 8.3.x, thanks!

I was going to ask for a more generic solution, but I think the more generic solution is #2571183: Deprecate random() usage in tests to avoid random test failures and that's still under discussion. So just adding it as a related issue.

Status: Fixed » Closed (fixed)

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