Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Drop the unstable parallel duration comparison - #3129

Open
luoye520ww wants to merge 1 commit into
pester:mainfrom
luoye520ww:fix/parallel-duration-check
Open

luoye520ww wants to merge 1 commit into
pester:mainfrom
luoye520ww:fix/parallel-duration-check

Conversation

@luoye520ww

Copy link
Copy Markdown

PR Summary

Runspace setup counts toward the run's wall-clock time but not the container durations. On a slow runner it can eat up the overlap, so the run can outlast the container sum without anything being wrong. Drop that comparison and keep the stopwatch bound and per-phase checks.

Ran tst/Pester.RSpec.Parallel.ts.ps1 -NoBuild -PassThru on Windows: 61 passed on PowerShell 5.1 and 61 passed on PowerShell 7.6.

Fix #3117

@codecov

codecov Bot commented Dec 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@5f29e9d). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3129   +/-   ##
=======================================
  Coverage        ?   91.85%           
=======================================
  Files           ?        2           
  Lines           ?     8762           
  Branches        ?        0           
=======================================
  Hits            ?     8048           
  Misses          ?      714           
  Partials        ?        0           
Flag Coverage Δ
ps51-windows-2022 91.32% <ø> (?)
ps51-windows-latest 91.32% <ø> (?)
ps7-macos-15 90.76% <ø> (?)
ps7-macos-latest 90.76% <ø> (?)
ps7-ubuntu-2204 90.77% <ø> (?)
ps7-ubuntu-latest 90.77% <ø> (?)
ps7-windows-2022 91.41% <ø> (?)
ps7-windows-latest 91.41% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nohwnd

nohwnd commented Dec 6, 2026

Copy link
Copy Markdown
Member

The assertion you dropped was the only one that checked the thing this test is named after. What is left passes if Run.Duration goes back to being the sum of the container durations: two files sleeping a second each sum to about two seconds, and the caller's stopwatch is above that on any machine where runspace setup takes a moment. So the test would stay green if pester/Pester#2794 - [v6 Parallel] Total durations are wrong came back.

The margin is what is wrong, not the assertion. Setup sits outside the containers and can outweigh what the overlap saves, which is what I wrote in pester/Pester#3117 - The parallel wall-clock test compares the run total with the container sum, which a slow agent can invert. If the two files sleep five seconds each, the sum is ten seconds, the wall clock stays near five plus setup, and the comparison holds even on a slow agent. That costs the suite a few seconds.

If those seconds are not worth it, I would rather delete the test than keep one that says it checks the run total and does not.

🤖

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.

The parallel wall-clock test compares the run total with the container sum, which a slow agent can invert

2 participants