Problem/Motivation

The original problem was that "Branch tests for 9.3.x are failing."

Example: https://dispatcher.drupalci.org/job/drupal8_core_regression_tests/38082/...

https://www.drupal.org/pift-ci-job/2049841

This was fixed in #3038596: Mechanism that adds custom drupalci.yml configurations does not detect configs in new branches.

This is now a follow up to remove the table counting from \Drupal\Tests\Scripts\TestSiteApplicationTest::testInstallWithNonExistingFile().

Steps to reproduce

Proposed resolution

Remove the table counting from \Drupal\Tests\Scripts\TestSiteApplicationTest::testInstallWithNonExistingFile(). See #4

Remaining tasks

Review
Commit and smile.

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#11 3211992-11.patch1.54 KBalexpott

Comments

catch created an issue. See original summary.

catch’s picture

Version: 10.0.x-dev » 9.3.x-dev
alexpott’s picture

This happens when a unit test that touches the database runs at the same time as tests in\Drupal\Tests\Scripts\TestSiteApplicationTest::testInstallWithNonExistingFile

You can cause the error by running ./vendor/bin/phpunit -v core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php --filter testInstallScript in one terminal and then in another terminal you can do ./vendor/bin/phpunit -v core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php --filter testInstallWithNonExistingFile repeatedly till it fails for this reason.

This used to happen on tests for security issues because they ran all tests in one go whereas core tests use core/drupalci.yml which splits them up and makes this not happen because this test's methods are run sequentially and there are no other unit tests that create database tables.

alexpott’s picture

catch’s picture

Title: 9.3.x TestSiteApplicationTest is failing » 9.3.x TestSiteApplicationTest fails when DrupalCI doesn't pick up drupalci.yml (concurrent test type runs)

Trying a re-title.

ressa’s picture

Thanks for fixing this, it looks like the failing test passes now:

19:08:01 Drupal\Tests\Scripts\TestSiteApplicationTest 7 passes

From https://dispatcher.drupalci.org/job/drupal8_core_regression_tests/38131/...

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Active » Needs review

According to #4 this will be fixed by #3038596: Mechanism that adds custom drupalci.yml configurations does not detect configs in new branches., which was committed 5 days ago.

What, if anything is left to do here?

quietone’s picture

Issue tags: +Bug Smash Initiative

This is one of the fortnightly triage issues for bug smash.

alexpott’s picture

Title: 9.3.x TestSiteApplicationTest fails when DrupalCI doesn't pick up drupalci.yml (concurrent test type runs) » TestSiteApplicationTest::testInstallWithNonExistingFile() fails when another test creates database tables during the test run
Priority: Critical » Normal
Status: Needs review » Needs work

I think given that #3038596: Mechanism that adds custom drupalci.yml configurations does not detect configs in new branches. this is no longer critical. However I think we could still decide to remove the table counting from \Drupal\Tests\Scripts\TestSiteApplicationTest::testInstallWithNonExistingFile() as it is counting tables on the main connection of the runner so that's always going to be fragile. Maybe the correct thing to do here is to test something else from the install process other than table creation. Looking at \Drupal\TestSite\Commands\TestSiteInstallCommand::execute() and when \Drupal\TestSite\Commands\TestSiteInstallCommand::getSetupClass() perhaps the best we can do it test for the exception text (as we are already doing) and be done.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new1.54 KB

Here's the suggested fix

quietone’s picture

Issue summary: View changes

Just IS updates

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

However I think we could still decide to remove the table counting from \Drupal\Tests\Scripts\TestSiteApplicationTest::testInstallWithNonExistingFile() as it is counting tables on the main connection of the runner so that's always going to be fragile.

That seems like a reasonable thing to do, the removal of this part reduces fragility which is a great thing to do.

  • catch committed f67f194 on 10.0.x
    Issue #3211992 by alexpott, catch, quietone: TestSiteApplicationTest::...
  • catch committed ce4bc2f on 10.1.x
    Issue #3211992 by alexpott, catch, quietone: TestSiteApplicationTest::...
  • catch committed 74467cb on 9.5.x
    Issue #3211992 by alexpott, catch, quietone: TestSiteApplicationTest::...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.