From 583b4bba56357d3b6fb26dfd91ce9f828a351e54 Mon Sep 17 00:00:00 2001 From: Michael Strelan <mstrelan@gmail.com> Date: Tue, 25 Mar 2025 10:05:50 +1000 Subject: [PATCH 1/3] Repeat 1000 times --- .gitlab-ci/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/pipeline.yml b/.gitlab-ci/pipeline.yml index ee6f1e0e1769..6e9bd8bb1f90 100644 --- a/.gitlab-ci/pipeline.yml +++ b/.gitlab-ci/pipeline.yml @@ -113,7 +113,7 @@ variables: echo ' "Key" to "REPEAT_TEST_CLASS" and "Value" to "Drupal\Tests\ckeditor5\FunctionalJavascript\MediaLinkabilityTest"'; exit 1; else - sudo -u www-data -E -H php ./core/scripts/run-tests.sh --color --keep-results --concurrency "$CONCURRENCY" --repeat "100" --sqlite "./sites/default/files/tests.sqlite" --dburl $SIMPLETEST_DB --url $SIMPLETEST_BASE_URL --verbose --non-html --class $REPEAT_TEST_CLASS + sudo -u www-data -E -H php ./core/scripts/run-tests.sh --color --keep-results --concurrency "$CONCURRENCY" --repeat "1000" --sqlite "./sites/default/files/tests.sqlite" --dburl $SIMPLETEST_DB --url $SIMPLETEST_BASE_URL --verbose --non-html --class $REPEAT_TEST_CLASS fi ################ @@ -241,7 +241,7 @@ variables: when: manual allow_failure: true variables: - REPEAT_TEST_CLASS: 'Drupal\Tests\Change\Me' + REPEAT_TEST_CLASS: '\Drupal\Tests\system\Functional\Theme\ToolbarClaroOverridesTest' services: - <<: *with-database -- GitLab From 5de2fb244a38a1e2d9d29f76470a96f50bac1ae2 Mon Sep 17 00:00:00 2001 From: Michael Strelan <mstrelan@gmail.com> Date: Tue, 25 Mar 2025 10:27:38 +1000 Subject: [PATCH 2/3] Wait terminate perhaps --- .../tests/src/Functional/Theme/ToolbarClaroOverridesTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php b/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php index ec113eeab86a..ae0f9c9cd947 100644 --- a/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php +++ b/core/modules/system/tests/src/Functional/Theme/ToolbarClaroOverridesTest.php @@ -6,6 +6,7 @@ use Drupal\Core\Theme\ThemeManagerInterface; use Drupal\Tests\BrowserTestBase; +use Drupal\Tests\WaitTerminateTestTrait; /** * Tests the loading of Claro assets on a non-Claro default theme. @@ -14,6 +15,8 @@ */ class ToolbarClaroOverridesTest extends BrowserTestBase { + use WaitTerminateTestTrait; + /** * {@inheritdoc} */ @@ -56,6 +59,8 @@ protected function setUp(): void { 'administer shortcuts', 'access content overview', ])); + + $this->setWaitForTerminate(); } /** -- GitLab From f200dd51ec666dd1f8180c0ada85f9f57507db5d Mon Sep 17 00:00:00 2001 From: Michael Strelan <mstrelan@gmail.com> Date: Tue, 25 Mar 2025 10:35:24 +1000 Subject: [PATCH 3/3] phpstan --- core/.phpstan-baseline.php | 42 ------------------- .../Drupal/Tests/WaitTerminateTestTrait.php | 2 +- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php index 95ec5db24667..c99db935f3a6 100644 --- a/core/.phpstan-baseline.php +++ b/core/.phpstan-baseline.php @@ -21111,12 +21111,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/jsonapi/tests/src/Functional/NodeTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Drupal\\\\Tests\\\\jsonapi\\\\Functional\\\\NodeTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/jsonapi/tests/src/Functional/NodeTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\jsonapi\\\\Functional\\\\ResourceTestBase\\:\\:addEntityTypeAndBundleToWorkflow\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', @@ -21987,12 +21981,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/language/tests/language_test/src/Controller/LanguageTestController.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Drupal\\\\Tests\\\\language\\\\Functional\\\\ConfigurableLanguageManagerTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\language\\\\Functional\\\\LanguageBreadcrumbTest\\:\\:assertBreadcrumb\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', @@ -24261,12 +24249,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Drupal\\\\Tests\\\\locale\\\\Functional\\\\LocaleLocaleLookupTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\locale\\\\Functional\\\\LocalePathTest\\:\\:assertPathAliasExists\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', @@ -29475,12 +29457,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/path/src/Plugin/Validation/Constraint/PathAliasConstraintValidator.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Drupal\\\\Tests\\\\path\\\\Functional\\\\PathAliasTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/path/tests/src/Functional/PathAliasTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\path\\\\Functional\\\\PathContentModerationTest\\:\\:addEntityTypeAndBundleToWorkflow\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', @@ -36577,12 +36553,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/system/tests/src/Functional/System/CronRunTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Drupal\\\\Tests\\\\system\\\\Functional\\\\System\\\\CronRunTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/system/tests/src/Functional/System/CronRunTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\system\\\\Functional\\\\System\\\\DateTimeTest\\:\\:assertFieldDoesNotExist\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', @@ -47449,12 +47419,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Functional\\\\Plugin\\\\DisplayFeedTranslationTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Functional\\\\Plugin\\\\DisplayPageWebTest\\:\\:assertCacheContext\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', @@ -49885,12 +49849,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method Drupal\\\\Tests\\\\workspaces\\\\Functional\\\\PathWorkspacesTest\\:\\:setWaitForTerminate\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\workspaces\\\\Functional\\\\PathWorkspacesTest\\:\\:setupWorkspaceSwitcherBlock\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', diff --git a/core/tests/Drupal/Tests/WaitTerminateTestTrait.php b/core/tests/Drupal/Tests/WaitTerminateTestTrait.php index 2423af83f9dd..ad629abbae4e 100644 --- a/core/tests/Drupal/Tests/WaitTerminateTestTrait.php +++ b/core/tests/Drupal/Tests/WaitTerminateTestTrait.php @@ -16,7 +16,7 @@ trait WaitTerminateTestTrait { * Tests with assertions which operate on data computed during the terminate * event need to enable this. */ - protected function setWaitForTerminate() { + protected function setWaitForTerminate(): void { $this->container->get('state')->set('drupal.test_wait_terminate', TRUE); } -- GitLab