Skip to content

Temporary file used by SourceMapper may be deleted prematurely when multiple PHPUnit processes run in parallel #6503

@mbeccati

Description

@mbeccati
Q A
PHPUnit version 11.5.52
PHP version 8.2
Installation Method Composer

Summary

The Symfony Test suite on my CI has started failing since 2 days. The failures started when PHPUnit switched from 11.5.51 to 11.5.52. The same happens across other newly release versions when using more recent PHP versions. My suspicions go to 20702bf.

Current behavior

From https://github.com/mbeccati/php-latest-builds/actions/runs/21816468162/job/62939084841:

1) Symfony\Component\Mailer\Tests\Exception\UnsupportedSchemeExceptionTest::testMessageWhereSchemeIsPartOfSchemeToPackageMap with data set #0 ('ahasend', 'symfony/aha-send-mailer')
PHPUnit\Framework\Exception: Warning: file_get_contents(/tmp/phpunit_gumC1F): Failed to open stream: No such file or directory in /home/runner/work/php-latest-builds/php-latest-builds/.phpunit/phpunit-11.5-0/src/TextUI/Configuration/SourceMapper.php on line 45

/home/runner/work/php-latest-builds/php-latest-builds/.phpunit/phpunit-11.5-0/phpunit:104
/home/runner/work/php-latest-builds/php-latest-builds/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php:458
/home/runner/work/php-latest-builds/php-latest-builds/vendor/symfony/phpunit-bridge/bin/simple-phpunit:13

...

121) Symfony\Bundle\FrameworkBundle\Tests\Controller\ControllerHelperTest::testAddFlash
PHPUnit\Framework\Exception: Warning: file_get_contents(/tmp/phpunit_gumC1F): Failed to open stream: No such file or directory in /home/runner/work/php-latest-builds/php-latest-builds/.phpunit/phpunit-11.5-0/src/TextUI/Configuration/SourceMapper.php on line 45

/home/runner/work/php-latest-builds/php-latest-builds/.phpunit/phpunit-11.5-0/phpunit:104
/home/runner/work/php-latest-builds/php-latest-builds/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php:458
/home/runner/work/php-latest-builds/php-latest-builds/vendor/symfony/phpunit-bridge/bin/simple-phpunit:13

How to reproduce

I was able to reproduce locally, but at the moment I have no time to debug and possibly make a PR, sorry.

Fresh clone of SF 7.4, composer install and ./phpunit with the --log-junit option.

Expected behavior

No Failed to open stream errors from PHPUnit.

Metadata

Metadata

Labels

feature/test-runnerCLI test runnertype/bugSomething is brokenversion/11Something affects PHPUnit 11version/12Something affects PHPUnit 12version/13Something affects PHPUnit 13

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions