Skip to content

fix: use atomic counter in pet-pipenv test temp dirs to prevent parallel collisions#408

Merged
karthiknadig merged 1 commit intomainfrom
fix/pipenv-flaky-test
Apr 6, 2026
Merged

fix: use atomic counter in pet-pipenv test temp dirs to prevent parallel collisions#408
karthiknadig merged 1 commit intomainfrom
fix/pipenv-flaky-test

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

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).

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 73.2%
Base Branch Coverage 73.2%
Delta 0% ➖

Coverage unchanged.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Performance Report (Linux) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 2ms 1ms 0ms 0%
Full Refresh 97ms 543ms 79ms 18ms 20.0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 77ms 612ms 61ms 16ms
Full Refresh 149ms 33162ms 118ms 31ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Performance Report (Windows) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 11ms 16ms 9ms 2ms 22.2%
Full Refresh 185ms 649ms 154ms 31ms 20.1%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 69.4%
Base Branch Coverage 69.41%
Delta -0.01% ❌

Coverage decreased. Please add tests for new code.

@karthiknadig karthiknadig marked this pull request as ready for review April 6, 2026 17:21
@karthiknadig karthiknadig enabled auto-merge (squash) April 6, 2026 17:21
@karthiknadig karthiknadig merged commit 2a12535 into main Apr 6, 2026
30 checks passed
@karthiknadig karthiknadig deleted the fix/pipenv-flaky-test branch April 6, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants