Commit 2a12535
authored
fix: use atomic counter in pet-pipenv test temp dirs to prevent parallel collisions (#408)
The `unique_temp_dir()` helper in pet-pipenv tests used
`SystemTime::now().as_nanos()` to generate temp directory names. On
Windows, `SystemTime` has ~15.6ms resolution, so parallel test threads
can get the same value — causing one test's cleanup (`remove_dir_all`)
to destroy another test's files mid-execution.
**Fix:** Replace the nanos-based name with `process_id + AtomicU64
counter`, which is guaranteed unique across parallel test threads within
the same test binary.
This was observed as a flaky
`detect_pipenv_centralized_env_without_project_file_via_naming_pattern`
failure on Windows CI (e.g., PR #407 CI run).1 parent f93254b commit 2a12535
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| |||
0 commit comments