diff --git a/core/modules/jsonapi/tests/src/Functional/NodeTest.php b/core/modules/jsonapi/tests/src/Functional/NodeTest.php index 2496d242f23f4209cfa90701589596d92b6859f0..4fb79a7c66e3f611e8afa288f5febba7a221f211 100644 --- a/core/modules/jsonapi/tests/src/Functional/NodeTest.php +++ b/core/modules/jsonapi/tests/src/Functional/NodeTest.php @@ -317,6 +317,9 @@ public function testPatchPath() { * {@inheritdoc} */ public function testGetIndividual() { + // Cacheable normalizations are written after the response is flushed to + // the client. We use WaitTerminateTestTrait to wait for Drupal to perform + // its termination work before continuing. $this->setWaitForTerminate(); parent::testGetIndividual(); diff --git a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php index eb11a0cd5f050138ccb498d6cc48ce23380858af..48089d7b9a5001408b4a1bfb3e7cbb61b525e88f 100644 --- a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php +++ b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php @@ -48,6 +48,9 @@ class ConfigurableLanguageManagerTest extends BrowserTestBase { protected function setUp(): void { parent::setUp(); + // The \Drupal\locale\LocaleTranslation service clears caches after the + // response is flushed to the client. We use WaitTerminateTestTrait to wait + // for Drupal to perform its termination work before continuing. $this->setWaitForTerminate(); /** @var \Drupal\user\UserInterface $user */ diff --git a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php index 34e763e7ad136aa5ef1fc03a5860128a644a9707..7ea710286ee10b589e7530128537bbc328e227d1 100644 --- a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php @@ -34,6 +34,9 @@ class LocaleLocaleLookupTest extends BrowserTestBase { protected function setUp(): void { parent::setUp(); + // The \Drupal\locale\LocaleTranslation service stores localization cache + // data after the response is flushed to the client. We do not want to race + // with any string translations that may be saving from the login below. $this->setWaitForTerminate(); // Change the language default object to different values. diff --git a/core/modules/path/tests/src/Functional/PathAliasTest.php b/core/modules/path/tests/src/Functional/PathAliasTest.php index 080725afb5e6d79b3edb03c4ce857882a2f8e81d..335dfe98773371837601a1b88255784eb2e48734 100644 --- a/core/modules/path/tests/src/Functional/PathAliasTest.php +++ b/core/modules/path/tests/src/Functional/PathAliasTest.php @@ -44,6 +44,9 @@ protected function setUp(): void { ]); $this->drupalLogin($web_user); + // The \Drupal\path_alias\AliasWhitelist service performs cache clears after + // Drupal has flushed the response to the client. We use + // WaitTerminateTestTrait to wait for Drupal to do this before continuing. $this->setWaitForTerminate(); } diff --git a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php index 6b5da5aec68c8bf8908c2f1547703d6e6e391b04..eb92e908dd98e66d838f6a61bac35c15747b440e 100644 --- a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php +++ b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php @@ -69,6 +69,10 @@ protected function setUp(): void { \Drupal::entityTypeManager()->clearCachedDefinitions(); $this->setupWorkspaceSwitcherBlock(); + + // The \Drupal\path_alias\AliasWhitelist service performs cache clears after + // Drupal has flushed the response to the client. We use + // WaitTerminateTestTrait to wait for Drupal to do this before continuing. $this->setWaitForTerminate(); }