[random test failure] InstallerExistingConfig[SyncDirectory]MultilingualTest::testConfigSync

Created on 17 May 2023, over 1 year ago
Updated 3 August 2023, over 1 year ago

Problem/Motivation

Since 📌 Update to Symfony 6.3 Fixed there have been fairly frequent random fails in InstallerExistingConfigMultilingualTest::testConfigSync and InstallerExistingConfigSyncDirectoryMultilingualTest::testConfigSync in the daily and commit tests of 10.1.x and 11.x.
Seen in both PHP 8.1 and 8.2, as well as in various DBs:
https://www.drupal.org/pift-ci-job/2671078
https://www.drupal.org/pift-ci-job/2670145
https://www.drupal.org/pift-ci-job/2671067

The full PHPUnit error from DrupalCI is

1) Drupal\FunctionalTests\Installer\InstallerExistingConfigMultilingualTest::testConfigSync
Exception: Drupal\language\Exception\DeleteDefaultLanguageException: Can not delete the default language
Drupal\language\Entity\ConfigurableLanguage::preDelete()() (Line: 177)

/var/www/html/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:47
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:204
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:153
/var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php:48
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:248
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:224
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:269
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:226
/var/www/html/vendor/guzzlehttp/promises/src/Promise.php:62
/var/www/html/vendor/guzzlehttp/guzzle/src/Client.php:187
/var/www/html/core/tests/Drupal/Tests/DrupalTestBrowser.php:137
/var/www/html/vendor/symfony/browser-kit/AbstractBrowser.php:403
/var/www/html/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:111
/var/www/html/vendor/behat/mink/src/Session.php:148
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:237
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:443
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:244
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:443
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:244
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:443
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:244
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:443
/var/www/html/core/tests/Drupal/Tests/UiHelperTrait.php:106
/var/www/html/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php:259
/var/www/html/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php:179
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

Steps to reproduce

https://www.drupal.org/node/3060/qa

So when things go bad, the last HTML output page (see https://www.drupal.org/files/issues/2023-05-21/Importing%20configuration... which is an HTML file I had to rename to .txt to be able to upload) states

The website encountered an unexpected error. Please try again later.
Drupal\language\Exception\DeleteDefaultLanguageException: Can not delete the default language in Drupal\language\Entity\ConfigurableLanguage::preDelete() (line 177 of core/modules/language/src/Entity/ConfigurableLanguage.php).

Drupal\language\Entity\ConfigurableLanguage::preDelete(Object, Array) (Line: 450)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 347)
Drupal\Core\Entity\EntityBase->delete() (Line: 950)
Drupal\Core\Config\ConfigImporter->checkOp('language.es', 'create', 'language.entity.en') (Line: 662)
Drupal\Core\Config\ConfigImporter->processConfigurations(Array) (Line: 561)
Drupal\Core\Config\ConfigImporter->doSyncStep('processConfigurations', Array) (Line: 31)
Drupal\Core\Config\Importer\ConfigImporterBatch::process(Object, 'processConfigurations', Array) (Line: 296)
_batch_process() (Line: 187)
_batch_progress_page() (Line: 87)
_batch_page(Object) (Line: 664)
install_run_task(Array, Array) (Line: 569)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)

The only way this could happen is when $this->storageComparer->getTargetStorage($collection)->exists($name) at https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co... returns TRUE.

Which leads me to believe that somehow, since SF6.3 \Drupal\Core\Config\CachedStorage can leak between tests.

Proposed resolution

Re-enable both disabled test, lenghty explanation why can be found in #3361121-57: [random test failure] InstallerExistingConfig[SyncDirectory]MultilingualTest::testConfigSync .

Remaining tasks


User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Fixed

Version

11.0 🔥

Component
PHPUnit 

Last updated about 3 hours ago

Created by

🇬🇧United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024