From a113fcd9ec89e89cd427f9a9428c2d56c552a637 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 10:55:30 +0200 Subject: [PATCH 1/9] Update pr.yml --- .github/workflows/pr.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7881e76a..fb2e1a98 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -31,12 +31,13 @@ jobs: php-version: - "8.2" test-args: - - "--group Database" + - "modules/file/tests/src/Functional/FileManagedFileElementTest.php" +# - "--group Database" # - "--group Entity" # - "--group Cache,Config" - - "--group field,Field" - - "--group file" - - "--group views" +# - "--group field,Field" +# - "--group file" +# - "--group views" services: mysql: From 0ebe3f2e3c8da0ae5df5f8ec91f25fde06b5a869 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 10:56:30 +0200 Subject: [PATCH 2/9] Delete 3295790-revert.patch --- tests/github/3295790-revert.patch | 453 ------------------------------ 1 file changed, 453 deletions(-) delete mode 100644 tests/github/3295790-revert.patch diff --git a/tests/github/3295790-revert.patch b/tests/github/3295790-revert.patch deleted file mode 100644 index 9b4646fa..00000000 --- a/tests/github/3295790-revert.patch +++ /dev/null @@ -1,453 +0,0 @@ -diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php -index 8dc9bac392e..b5fc2aaf25a 100644 ---- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php -+++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php -@@ -12,7 +12,6 @@ - use Drupal\Core\Site\Settings; - use Symfony\Component\HttpFoundation\Request; - use Symfony\Component\HttpFoundation\Response; --use Symfony\Component\HttpFoundation\StreamedResponse; - use Symfony\Component\HttpKernel\Event\ResponseEvent; - use Symfony\Component\HttpKernel\KernelEvents; - use Symfony\Component\EventDispatcher\EventSubscriberInterface; -@@ -299,21 +298,6 @@ protected function setExpiresNoCache(Response $response) { - $response->setExpires(\DateTime::createFromFormat('j-M-Y H:i:s T', '19-Nov-1978 05:00:00 UTC')); - } - -- /** -- * Sets the Content-Length header on the response. -- * -- * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event -- * The event to process. -- */ -- public function setContentLengthHeader(ResponseEvent $event): void { -- $response = $event->getResponse(); -- if ($response instanceof StreamedResponse) { -- return; -- } -- -- $response->headers->set('Content-Length', strlen($response->getContent()), TRUE); -- } -- - /** - * Registers the methods in this class that should be listeners. - * -@@ -325,10 +309,6 @@ public static function getSubscribedEvents(): array { - // There is no specific reason for choosing 16 beside it should be executed - // before ::onRespond(). - $events[KernelEvents::RESPONSE][] = ['onAllResponds', 16]; -- // Run very late, after all other response subscribers have run. However, -- // any response subscribers that convert a response to a streamed response -- // must run after this and undo what this does. -- $events[KernelEvents::RESPONSE][] = ['setContentLengthHeader', -1024]; - return $events; - } - -diff --git a/core/misc/cspell/dictionary.txt b/core/misc/cspell/dictionary.txt -index ec6dd524716..356677a4bce 100644 ---- a/core/misc/cspell/dictionary.txt -+++ b/core/misc/cspell/dictionary.txt -@@ -612,6 +612,7 @@ linkset - linktext - lisu - litespeed -+litererally - llamaids - llamasarelame - llamma -diff --git a/core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php b/core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php -index 03e1d4261cd..e818522a69f 100644 ---- a/core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php -+++ b/core/modules/big_pipe/src/EventSubscriber/HtmlResponseBigPipeSubscriber.php -@@ -82,8 +82,6 @@ public function onRespond(ResponseEvent $event) { - $content = $response->getContent(); - $content = str_replace('', '', $content); - $response->setContent($content); -- // FinishResponseSubscriber::setContentLengthHeader() already ran. -- $response->headers->set('Content-Length', strlen($content), TRUE); - } - - // If there are neither BigPipe placeholders nor no-JS BigPipe placeholders, -@@ -95,10 +93,6 @@ public function onRespond(ResponseEvent $event) { - - $big_pipe_response = new BigPipeResponse($response); - $big_pipe_response->setBigPipeService($this->getBigPipeService($event)); -- -- // A BigPipe response's length is impossible to predict. -- $big_pipe_response->headers->remove('Content-Length'); -- - $event->setResponse($big_pipe_response); - } - -diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php -index 3dc853f61da..a779ca9a0ec 100644 ---- a/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php -+++ b/core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php -@@ -1300,13 +1300,10 @@ public function testNonCacheableMethods() { - $methods = [ - 'HEAD', - 'GET', -+ 'PATCH', -+ 'DELETE', - ]; -- foreach ($methods as $method) { -- $response = $this->request($method, Url::fromUri('internal:/jsonapi/node/article/' . $node->uuid()), $base_request_options); -- $this->assertSame(200, $response->getStatusCode()); -- } -- -- $patch_request_options = $base_request_options + [ -+ $non_post_request_options = $base_request_options + [ - RequestOptions::JSON => [ - 'data' => [ - 'type' => 'node--article', -@@ -1314,11 +1311,10 @@ public function testNonCacheableMethods() { - ], - ], - ]; -- $response = $this->request('PATCH', Url::fromUri('internal:/jsonapi/node/article/' . $node->uuid()), $patch_request_options); -- $this->assertSame(200, $response->getStatusCode()); -- -- $response = $this->request('DELETE', Url::fromUri('internal:/jsonapi/node/article/' . $node->uuid()), $base_request_options); -- $this->assertSame(204, $response->getStatusCode()); -+ foreach ($methods as $method) { -+ $response = $this->request($method, Url::fromUri('internal:/jsonapi/node/article/' . $node->uuid()), $non_post_request_options); -+ $this->assertSame($method === 'DELETE' ? 204 : 200, $response->getStatusCode()); -+ } - - $post_request_options = $base_request_options + [ - RequestOptions::JSON => [ -diff --git a/core/modules/jsonapi/tests/src/Functional/NodeTest.php b/core/modules/jsonapi/tests/src/Functional/NodeTest.php -index d0893201e1a..9c9f5b16c60 100644 ---- a/core/modules/jsonapi/tests/src/Functional/NodeTest.php -+++ b/core/modules/jsonapi/tests/src/Functional/NodeTest.php -@@ -393,15 +393,11 @@ protected function assertCacheableNormalizations(): void { - $request_options = $this->getAuthenticationRequestOptions(); - $request_options[RequestOptions::QUERY] = ['fields' => ['node--camelids' => 'title']]; - $this->request('GET', $url, $request_options); -- // Cacheable normalizations are written after the response is flushed to -- // the client; give the server a chance to complete this work. -- sleep(1); - // Ensure the normalization cache is being incrementally built. After - // requesting the title, only the title is in the cache. - $this->assertNormalizedFieldsAreCached(['title']); - $request_options[RequestOptions::QUERY] = ['fields' => ['node--camelids' => 'field_rest_test']]; - $this->request('GET', $url, $request_options); -- sleep(1); - // After requesting an additional field, then that field is in the cache and - // the old one is still there. - $this->assertNormalizedFieldsAreCached(['title', 'field_rest_test']); -diff --git a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php -index 2c1f529f504..9bc09517ce2 100644 ---- a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php -+++ b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php -@@ -266,16 +266,4 @@ public function testUserProfileTranslationWithPreferredAdminLanguage() { - $assert_session->pageTextNotContains($field_label_es); - } - -- /** -- * {@inheritdoc} -- */ -- protected function drupalGet($path, array $options = [], array $headers = []) { -- $response = parent::drupalGet($path, $options, $headers); -- // The \Drupal\locale\LocaleTranslation service clears caches after the -- // response is flushed to the client; wait for Drupal to perform its -- // termination work before continuing. -- sleep(1); -- return $response; -- } -- - } -diff --git a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php -index 5b43ad50bf1..9ba855d1f15 100644 ---- a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php -+++ b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php -@@ -68,11 +68,6 @@ public function testLanguageFallbackDefaults() { - * @dataProvider providerTestFixOldPluralStyle - */ - public function testFixOldPluralStyle($translation_value, $expected) { -- // 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 in -- // ::setUp(). -- sleep(1); - $string_storage = \Drupal::service('locale.storage'); - $string = $string_storage->findString(['source' => 'Member for', 'context' => '']); - $lid = $string->getId(); -diff --git a/core/modules/path/tests/src/Functional/PathAliasTest.php b/core/modules/path/tests/src/Functional/PathAliasTest.php -index f6ebeb9be32..1c8873344be 100644 ---- a/core/modules/path/tests/src/Functional/PathAliasTest.php -+++ b/core/modules/path/tests/src/Functional/PathAliasTest.php -@@ -66,9 +66,6 @@ public function testPathCache() { - \Drupal::cache('data')->deleteAll(); - // Make sure the path is not converted to the alias. - $this->drupalGet(trim($edit['path[0][value]'], '/'), ['alias' => TRUE]); -- // The \Drupal\path_alias\AliasWhitelist service performs cache clears after -- // Drupal has flushed the response to the client; wait for this to finish. -- sleep(1); - $this->assertNotEmpty(\Drupal::cache('data')->get('preload-paths:' . $edit['path[0][value]']), 'Cache entry was created.'); - - // Visit the alias for the node and confirm a cache entry is created. -@@ -76,7 +73,6 @@ public function testPathCache() { - // @todo Remove this once https://www.drupal.org/node/2480077 lands. - Cache::invalidateTags(['rendered']); - $this->drupalGet(trim($edit['alias[0][value]'], '/')); -- sleep(1); - $this->assertNotEmpty(\Drupal::cache('data')->get('preload-paths:' . $edit['path[0][value]']), 'Cache entry was created.'); - } - -diff --git a/core/modules/system/system.install b/core/modules/system/system.install -index fae06ecc272..af5c8634166 100644 ---- a/core/modules/system/system.install -+++ b/core/modules/system/system.install -@@ -501,17 +501,6 @@ function system_requirements($phase) { - } - } - -- if ($phase === 'runtime') { -- if (!function_exists('fastcgi_finish_request') && !function_exists('litespeed_finish_request') && !ob_get_status()) { -- $requirements['output_buffering'] = [ -- 'title' => t('Output Buffering'), -- 'error_value' => t('Not enabled'), -- 'severity' => REQUIREMENT_WARNING, -- 'description' => t('Output buffering is not enabled. This may degrade Drupal\'s performance. You can enable output buffering by default in your PHP settings.'), -- ]; -- } -- } -- - if ($phase == 'install' || $phase == 'update') { - // Test for PDO (database). - $requirements['database_extensions'] = [ -diff --git a/core/modules/system/tests/modules/destructable_test/destructable_test.info.yml b/core/modules/system/tests/modules/destructable_test/destructable_test.info.yml -deleted file mode 100644 -index ed91a243987..00000000000 ---- a/core/modules/system/tests/modules/destructable_test/destructable_test.info.yml -+++ /dev/null -@@ -1,5 +0,0 @@ --name: 'Tests for DestructableInterface' --type: module --description: 'Provides test services which implement DestructableInterface.' --package: Testing --version: VERSION -diff --git a/core/modules/system/tests/modules/destructable_test/destructable_test.routing.yml b/core/modules/system/tests/modules/destructable_test/destructable_test.routing.yml -deleted file mode 100644 -index 51eaae2d4b7..00000000000 ---- a/core/modules/system/tests/modules/destructable_test/destructable_test.routing.yml -+++ /dev/null -@@ -1,7 +0,0 @@ --destructable: -- path: '/destructable' -- defaults: -- _controller: '\Drupal\destructable_test\Controller\CallsDestructableServiceController::render' -- _title: 'Calls destructable service' -- requirements: -- _access: 'TRUE' -diff --git a/core/modules/system/tests/modules/destructable_test/destructable_test.services.yml b/core/modules/system/tests/modules/destructable_test/destructable_test.services.yml -deleted file mode 100644 -index 316ce275d04..00000000000 ---- a/core/modules/system/tests/modules/destructable_test/destructable_test.services.yml -+++ /dev/null -@@ -1,4 +0,0 @@ --services: -- Drupal\destructable_test\Destructable: -- tags: -- - { name: needs_destruction } -diff --git a/core/modules/system/tests/modules/destructable_test/src/Controller/CallsDestructableServiceController.php b/core/modules/system/tests/modules/destructable_test/src/Controller/CallsDestructableServiceController.php -deleted file mode 100644 -index 42b1e25def8..00000000000 ---- a/core/modules/system/tests/modules/destructable_test/src/Controller/CallsDestructableServiceController.php -+++ /dev/null -@@ -1,45 +0,0 @@ --get(Destructable::class)); -- } -- -- public function __construct(Destructable $destructable) { -- $this->destructable = $destructable; -- } -- -- /** -- * Render callback. -- * -- * @return \Symfony\Component\HttpFoundation\Response -- * Response. -- */ -- public function render(Request $request): Response { -- $this->destructable->setSemaphore($request->query->get('semaphore')); -- return new Response('This is a longer-ish string of content to send to the client, to invoke any trivial transfer buffers both on the server and client side.'); -- } -- --} -diff --git a/core/modules/system/tests/modules/destructable_test/src/Destructable.php b/core/modules/system/tests/modules/destructable_test/src/Destructable.php -deleted file mode 100644 -index 210adc70aca..00000000000 ---- a/core/modules/system/tests/modules/destructable_test/src/Destructable.php -+++ /dev/null -@@ -1,34 +0,0 @@ --semaphore = $semaphore; -- } -- -- /** -- * {@inheritdoc} -- */ -- public function destruct() { -- sleep(3); -- file_put_contents($this->semaphore, 'ran'); -- } -- --} -diff --git a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php -index b806e582d6a..03f44fec4ba 100644 ---- a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php -+++ b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php -@@ -332,8 +332,8 @@ public function shutdownFunctions($arg1, $arg2) { - // the exception message can not be tested. - // @see _drupal_shutdown_function() - // @see \Drupal\system\Tests\System\ShutdownFunctionsTest -- if (function_exists('fastcgi_finish_request') || ob_get_status()) { -- return ['#markup' => 'The response will flush before shutdown functions are called.']; -+ if (function_exists('fastcgi_finish_request')) { -+ return ['#markup' => 'The function fastcgi_finish_request exists when serving the request.']; - } - return []; - } -diff --git a/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php b/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php -index 7c36abd3816..6d7798721c7 100644 ---- a/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php -+++ b/core/modules/system/tests/src/Functional/System/ShutdownFunctionsTest.php -@@ -42,18 +42,18 @@ public function testShutdownFunctions() { - $arg2 = $this->randomMachineName(); - $this->drupalGet('system-test/shutdown-functions/' . $arg1 . '/' . $arg2); - -- // If using PHP-FPM or output buffering, the response will be flushed to -- // the client before shutdown functions have fired. -+ // If using PHP-FPM then fastcgi_finish_request() will have been fired -+ // returning the response before shutdown functions have fired. - // @see \Drupal\system_test\Controller\SystemTestController::shutdownFunctions() -- $response_will_flush = strpos($this->getSession()->getPage()->getContent(), 'The response will flush before shutdown functions are called.'); -- if ($response_will_flush) { -+ $server_using_fastcgi = strpos($this->getSession()->getPage()->getContent(), 'The function fastcgi_finish_request exists when serving the request.'); -+ if ($server_using_fastcgi) { - // We need to wait to ensure that the shutdown functions have fired. - sleep(1); - } - $this->assertEquals([$arg1, $arg2], \Drupal::state()->get('_system_test_first_shutdown_function')); - $this->assertEquals([$arg1, $arg2], \Drupal::state()->get('_system_test_second_shutdown_function')); - -- if (!$response_will_flush) { -+ if (!$server_using_fastcgi) { - // Make sure exceptions displayed through - // \Drupal\Core\Utility\Error::renderExceptionSafe() are correctly - // escaped. -diff --git a/core/tests/Drupal/FunctionalTests/HttpKernel/DestructableServiceTest.php b/core/tests/Drupal/FunctionalTests/HttpKernel/DestructableServiceTest.php -deleted file mode 100644 -index 38cad0a6385..00000000000 ---- a/core/tests/Drupal/FunctionalTests/HttpKernel/DestructableServiceTest.php -+++ /dev/null -@@ -1,43 +0,0 @@ --container->get('file_system'); -- assert($file_system instanceof FileSystemInterface); -- $semaphore = $file_system -- ->tempnam($file_system->getTempDirectory(), 'destructable_semaphore'); -- $this->drupalGet(Url::fromRoute('destructable', [], ['query' => ['semaphore' => $semaphore]])); -- // This should be false as the response should flush before running the -- // test service. -- $this->assertEmpty(file_get_contents($semaphore), 'Destructable service did not run when response flushed to client.'); -- // The destructable service will sleep for 3 seconds, then run. -- // To ensure no race conditions on slow test runners, wait another 3s. -- sleep(6); -- $this->assertTrue(file_get_contents($semaphore) === 'ran', 'Destructable service did run.'); -- } -- --} -diff --git a/core/tests/Drupal/Tests/ApiRequestTrait.php b/core/tests/Drupal/Tests/ApiRequestTrait.php -index 83888277415..9a5431a2c7e 100644 ---- a/core/tests/Drupal/Tests/ApiRequestTrait.php -+++ b/core/tests/Drupal/Tests/ApiRequestTrait.php -@@ -37,12 +37,6 @@ trait ApiRequestTrait { - * @see \GuzzleHttp\ClientInterface::request() - */ - protected function makeApiRequest($method, Url $url, array $request_options) { -- // HEAD requests do not have bodies. If one is specified, Guzzle will not -- // ignore it and the request will be treated as GET with an overridden -- // method string, and libcurl will expect to read a response body. -- if ($method === 'HEAD' && array_key_exists('body', $request_options)) { -- unset($request_options['body']); -- } - $this->refreshVariables(); - $request_options[RequestOptions::HTTP_ERRORS] = FALSE; - $request_options[RequestOptions::ALLOW_REDIRECTS] = FALSE; From 9a562231247b23fd5976f35f22b4402a2b614064 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 10:56:59 +0200 Subject: [PATCH 3/9] Update drupal_patch.sh --- tests/github/drupal_patch.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/github/drupal_patch.sh b/tests/github/drupal_patch.sh index 2c46484e..c1f20f21 100755 --- a/tests/github/drupal_patch.sh +++ b/tests/github/drupal_patch.sh @@ -6,6 +6,3 @@ curl https://git.drupalcode.org/project/drupal/-/merge_requests/291.diff | git a #2992274 Installer tests fail if contrib driver hides database credentials form fields # curl https://www.drupal.org/files/issues/2022-06-01/2992274-25.patch | git apply -v git apply -v ./drudbal_staging/tests/github/2992274-local.patch - -#Revert #3295790 Post-response task running (destructable services) are actually blocking; add test coverage and warn for common misconfiguration -git apply -v ./drudbal_staging/tests/github/3295790-revert.patch From 34302f7e1362935ee19b3ef63d35c676e5ca7330 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 11:00:17 +0200 Subject: [PATCH 4/9] Update pr.yml --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index fb2e1a98..f946da89 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -31,7 +31,7 @@ jobs: php-version: - "8.2" test-args: - - "modules/file/tests/src/Functional/FileManagedFileElementTest.php" + - "core/modules/file/tests/src/Functional/FileFieldWidgetTest.php" # - "--group Database" # - "--group Entity" # - "--group Cache,Config" From f74c60821da51c5b038384855f8246d550de4a23 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 11:51:48 +0200 Subject: [PATCH 5/9] Update pr.yml --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f946da89..240620f0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -41,7 +41,7 @@ jobs: services: mysql: - image: "mysql:5.7" + image: "percona:5.7.22" options: >- -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=drudbal From 7dd97d3a00e6d26dffe4f84c28df9a7680e331b4 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 12:02:22 +0200 Subject: [PATCH 6/9] percona:5.7.22 --- .github/workflows/mysql.yml | 2 +- .github/workflows/mysqli.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml index 37d4d6d0..31ca0962 100644 --- a/.github/workflows/mysql.yml +++ b/.github/workflows/mysql.yml @@ -42,7 +42,7 @@ jobs: services: mysql: - image: "mysql:5.7" + image: "percona:5.7.22" options: >- -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=drudbal diff --git a/.github/workflows/mysqli.yml b/.github/workflows/mysqli.yml index 0e068b2e..755e3ae1 100644 --- a/.github/workflows/mysqli.yml +++ b/.github/workflows/mysqli.yml @@ -41,7 +41,7 @@ jobs: services: mysql: - image: "mysql:5.7" + image: "percona:5.7.22" options: >- -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=drudbal From 44d9c753df79e989212c2df4ffe1f8c880e476ee Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 12:33:33 +0200 Subject: [PATCH 7/9] i --- .github/workflows/mysql.yml | 2 +- .github/workflows/mysqli.yml | 2 +- .github/workflows/pr.yml | 2 +- tests/github/drupal_patch.sh | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml index 31ca0962..37d4d6d0 100644 --- a/.github/workflows/mysql.yml +++ b/.github/workflows/mysql.yml @@ -42,7 +42,7 @@ jobs: services: mysql: - image: "percona:5.7.22" + image: "mysql:5.7" options: >- -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=drudbal diff --git a/.github/workflows/mysqli.yml b/.github/workflows/mysqli.yml index 755e3ae1..0e068b2e 100644 --- a/.github/workflows/mysqli.yml +++ b/.github/workflows/mysqli.yml @@ -41,7 +41,7 @@ jobs: services: mysql: - image: "percona:5.7.22" + image: "mysql:5.7" options: >- -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=drudbal diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 240620f0..f946da89 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -41,7 +41,7 @@ jobs: services: mysql: - image: "percona:5.7.22" + image: "mysql:5.7" options: >- -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=drudbal diff --git a/tests/github/drupal_patch.sh b/tests/github/drupal_patch.sh index c1f20f21..c9ccc7f1 100755 --- a/tests/github/drupal_patch.sh +++ b/tests/github/drupal_patch.sh @@ -6,3 +6,6 @@ curl https://git.drupalcode.org/project/drupal/-/merge_requests/291.diff | git a #2992274 Installer tests fail if contrib driver hides database credentials form fields # curl https://www.drupal.org/files/issues/2022-06-01/2992274-25.patch | git apply -v git apply -v ./drudbal_staging/tests/github/2992274-local.patch + +#3375959 Add a way to delay executions in test runner until terminate event completed in the child site +curl https://git.drupalcode.org/project/drupal/-/merge_requests/4461.diff | git apply -v From 63fd65fe2afc16022151e5c29aa6d793db916e80 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 12:51:47 +0200 Subject: [PATCH 8/9] wait for terminate --- tests/github/drupal_patch.sh | 2 ++ tests/github/wait_for_terminate.patch | 28 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/github/wait_for_terminate.patch diff --git a/tests/github/drupal_patch.sh b/tests/github/drupal_patch.sh index c9ccc7f1..4be987cc 100755 --- a/tests/github/drupal_patch.sh +++ b/tests/github/drupal_patch.sh @@ -9,3 +9,5 @@ git apply -v ./drudbal_staging/tests/github/2992274-local.patch #3375959 Add a way to delay executions in test runner until terminate event completed in the child site curl https://git.drupalcode.org/project/drupal/-/merge_requests/4461.diff | git apply -v + +git apply -v ./drudbal_staging/tests/github/wait_for_terminate.patch diff --git a/tests/github/wait_for_terminate.patch b/tests/github/wait_for_terminate.patch new file mode 100644 index 00000000..ed056a3c --- /dev/null +++ b/tests/github/wait_for_terminate.patch @@ -0,0 +1,28 @@ +diff --git a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php +index 83e12945fd6..f3987733bfc 100644 +--- a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php ++++ b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php +@@ -10,6 +10,7 @@ + use Drupal\field\Entity\FieldConfig; + use Drupal\field\Entity\FieldStorageConfig; + use Drupal\Tests\field_ui\Traits\FieldUiTestTrait; ++use Drupal\Tests\WaitTerminateTestTrait; + use Drupal\user\RoleInterface; + use Drupal\file\Entity\File; + use Drupal\user\Entity\User; +@@ -24,6 +25,7 @@ class FileFieldWidgetTest extends FileFieldTestBase { + + use CommentTestTrait; + use FieldUiTestTrait; ++ use WaitTerminateTestTrait; + + /** + * {@inheritdoc} +@@ -41,6 +43,7 @@ class FileFieldWidgetTest extends FileFieldTestBase { + protected function setUp(): void { + parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); ++ $this->setWaitForTerminate(); + } + + /** From 6fb8701a934725bfa5a87073b98ef36c2fbcbdcb Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 4 Aug 2023 15:02:23 +0200 Subject: [PATCH 9/9] ii --- drudbal.install | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 drudbal.install diff --git a/drudbal.install b/drudbal.install new file mode 100644 index 00000000..03fe5241 --- /dev/null +++ b/drudbal.install @@ -0,0 +1,50 @@ +driver() === 'dbal' && $connection->databaseType() === 'mysql') { + $query = 'SELECT @@SESSION.tx_isolation'; + $isolation_level = $connection->query($query)->fetchField(); + $description = []; + if ($isolation_level == 'READ-COMMITTED') { + $severity_level = REQUIREMENT_OK; + } + else { + if ($isolation_level == 'REPEATABLE-READ') { + $severity_level = REQUIREMENT_WARNING; + } + else { + $severity_level = REQUIREMENT_ERROR; + $description[] = t('This is not supported by Drupal.'); + } + $description[] = t('The recommended level for Drupal is "READ COMMITTED".'); + } + $requirements['mysql_transaction_level'] = [ + 'title' => t('Transaction isolation level'), + 'severity' => $severity_level, + 'value' => $isolation_level, + 'description' => Markup::create(implode(' ', $description)), + ]; + } + } + } + + return $requirements; +}