Issue #3380433 by Spokje, quietone: [random test failure] CronRunTest::testAutomatedCron
parent
67360f2abd
commit
eaca861b38
|
@ -4,6 +4,7 @@ namespace Drupal\Tests\system\Functional\System;
|
|||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
use Drupal\Tests\Traits\Core\CronRunTrait;
|
||||
use Drupal\Tests\WaitTerminateTestTrait;
|
||||
|
||||
/**
|
||||
* Tests cron runs.
|
||||
|
@ -13,6 +14,7 @@ use Drupal\Tests\Traits\Core\CronRunTrait;
|
|||
class CronRunTest extends BrowserTestBase {
|
||||
|
||||
use CronRunTrait;
|
||||
use WaitTerminateTestTrait;
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
|
@ -56,7 +58,12 @@ class CronRunTest extends BrowserTestBase {
|
|||
* need the exact time when cron is triggered.
|
||||
*/
|
||||
public function testAutomatedCron() {
|
||||
// Test with a logged in user; anonymous users likely don't cause Drupal to
|
||||
// To prevent race conditions between the admin_user login triggering cron
|
||||
// and updating its state, and this test doing the same thing, we use
|
||||
// \Drupal\Tests\WaitTerminateTestTrait::setWaitForTerminate.
|
||||
$this->setWaitForTerminate();
|
||||
|
||||
// Test with a logged-in user; anonymous users likely don't cause Drupal to
|
||||
// fully bootstrap, because of the internal page cache or an external
|
||||
// reverse proxy. Reuse this user for disabling cron later in the test.
|
||||
$admin_user = $this->drupalCreateUser(['administer site configuration']);
|
||||
|
|
Loading…
Reference in New Issue