Commit 2d00d90
Fix parallel test race condition in lib.inc temp dir creation
tempnam(__DIR__, '.tmp') + unlink + mkdir has a TOCTOU window: another
parallel worker can call tempnam and get the same name after unlink but
before mkdir. With -j8 and all tests sharing __DIR__ (the run-tests
--temp-source/target dir), this reliably causes "File exists" and
"Resource temporarily unavailable" failures on Windows.
Replace with a loop on mkdir using PID + uniqid: the PID isolates each
concurrent test process, and mkdir is atomic so no window exists.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b4b821e commit 2d00d90
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments