Problem/Motivation

I am running the core drupal unit test suite using PHPUnit. The following failure is given.

Drupal\Tests\ComposerIntegrationTest::testVendorCleanup with data set #1 ('Drupal\Composer\Plugin\Vendor...Config', 'defaultConfig')
Failed asserting that an array contains 'behatted/mank'.

The string “BeHatted/Mank” is used in a different test, Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest

Steps to reproduce

Run PHPUnit against the entire unit test directory:

 <testsuite name="passing_unit">
      <directory suffix="Test.php">tests/Drupal/Tests</directory>
    </testsuite> 

Proposed resolution

Add * @runInSeparateProcess to ConfigTet:testMixedCaseConfigCleanupPackages

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3161320

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Beakerboy created an issue. See original summary.

beakerboy’s picture

Issue summary: View changes

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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.

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.

smustgrave’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

Wondering the exact steps you are taking or if there is something off in your phpunit.xml file?

Have not be able to replicate locally running random tests of all kinds.

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

neclimdul’s picture

Status: Postponed (maintainer needs more info) » Active

Pretty sure I figured out what's causing this. I'll follow up with some documentation but the details are mostly in the summary. Mostly you just need to run phpunit directly and you see the failure. If you run run-tests which splits everything into its own process you won't.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

beakerboy’s picture

Yes, one test must be modifying a file and not correctly cleaning itself after the test. This leaked test data is then contaminating a future test.

neclimdul’s picture

woops, got distracted and didn't follow up on those notes and lost all my changes from debugging this. From memory, ConfigTest::testMixedCaseConfigCleanupPackages was interacting with the global composer instance or something. The simple fix was just adding @runInSeparateProcess to the test and I think that resolved it.

neclimdul’s picture

Status: Active » Needs review

Well hello old me. Found this again testing PHPUnit 10 changes. Don't think its technically currently a blocker but gets in the way of testing so would be good to get out of the way since its such an easy fix.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Simple fix, updated issue summary to include proposed fix.

  • larowlan committed 5c3083ef on 10.2.x
    Issue #3161320 by neclimdul, Beakerboy, smustgrave: Drupal\Tests\...

  • larowlan committed 5b0361d8 on 11.x
    Issue #3161320 by neclimdul, Beakerboy, smustgrave: Drupal\Tests\...
larowlan’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 11.x and backported to 10.2.x

Nice find, simple fix

Status: Fixed » Closed (fixed)

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