test: prevent virtualenvwrapper temp directory collisions (Fixes #498) - #499
Merged
Conversation
Combine timestamp, process ID, and an atomic sequence so parallel tests cannot share cleanup paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Test Coverage Report (Linux)
Coverage increased! Great work! |
Performance Report (macOS)
Legend
|
Test Coverage Report (Windows)
Coverage increased! Great work! |
Performance Report (Windows) ✅
Legend
|
Performance Report (Linux) ✅
Legend
|
Copilot started reviewing on behalf of
Karthik Nadig (karthiknadig)
August 5, 2026 21:25
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the pet-virtualenvwrapper test suite against intermittent failures caused by temp directory name collisions during parallel execution. It updates the test-only directory naming scheme to remain unique even when the system clock has coarse resolution, while keeping the existing explicit cleanup approach.
Changes:
- Add a process-local
AtomicUsizesequence to guarantee unique test directory names under parallelism. - Preserve process ID and timestamp components in the temp directory name for additional uniqueness.
- Keep existing
remove_dir_all-based cleanup behavior in tests.
Show a summary per file
| File | Description |
|---|---|
| crates/pet-virtualenvwrapper/src/environments.rs | Updates test helper create_test_dir() to include an atomic sequence ID to prevent temp directory collisions during parallel tests. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
Karthik Nadig (karthiknadig)
marked this pull request as ready for review
August 5, 2026 22:48
Dmitriy Vasyura (dmitrivMS)
approved these changes
Aug 5, 2026
Raymond Zhao (rzhao271)
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
cargo test -p pet-virtualenvwrapper --lib --quietrunscargo test -p pet-virtualenvwrapper --lib.\scripts\rust-precommit.ps1Fixes #498