Skip to content

[Testing] Lock the fixture directory while a test uses its temp file - #8822

Merged
TomasVotruba merged 1 commit into
rectorphp:mainfrom
SanderMuller:lock-shared-fixture-directory
Oct 25, 2026
Merged

TomasVotruba merged 1 commit into
rectorphp:mainfrom
SanderMuller:lock-shared-fixture-directory

Conversation

@SanderMuller

Copy link
Copy Markdown
Contributor

PolyfillRectorTest and StrStartsWithRectorTest use the same Fixture/ directory. When fast-unit runs them at the same time, one test can delete the other's temp file, as in #8517. This failed main three times this month, for example https://github.com/rectorphp/rector-src/actions/runs/37998247855.

doTestFile() now locks .fixture.lock in the fixture directory until tearDown(). Only tests that share a directory wait for each other.

Two processes started together failed 7 of 10 times before this change, and 0 of 10 after.

@TomasVotruba
TomasVotruba merged commit 38ff4f2 into rectorphp:main Oct 25, 2026
49 checks passed
@TomasVotruba

Copy link
Copy Markdown
Member

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants