Test Coverage

Tests

35 tests across two suites. Every requirement is covered by at least one xUnit or Pester test.

20 xUnit (C#) 15 Pester (PS) 8 Adversarial Scenarios
01

Requirement → Test Matrix

REQ xUnit Tests Pester Tests Scenarios
REQ-01 TestPSInvocationSettingsTimeoutDefaultIsInfiniteTestPSInvocationSettingsTimeoutCanBeSetTestPSInvocationSettingsTimeoutZeroIsValid Timeout property default is InfiniteTimeSpanTimeout property can be set to a finite valueTimeout property zero is validTimeout property can be reset to InfiniteTimeSpan
REQ-02 TestInvokeThrowsTimeoutExceptionWhenExceededTestInvokeTimeoutExceptionMessageContainsTimeout Invoke with Timeout throws TimeoutException when command exceeds timeout 01-basic-timeout08-nested-timeout
REQ-02a TestInvokeCompletesWithinTimeoutTestInvokeDefaultTimeoutNeverExpires Invoke with default InfiniteTimeSpan completes fast commandsInvoke with default timeout does not expire for quick commands 01-basic-timeout
REQ-03
REQ-04 TestPoolAcquisitionTimeoutThrowsTestPoolAcquisitionSucceedsWithinTimeout Pool exhaustion throws TimeoutException with bounded waitPool with capacity succeeds within timeout 07-pool-exhaustion
REQ-05 TestStopWithTimeoutOverloadCompletesTestStopWithoutTimeoutRemainsBackwardsCompatibleTestStopTimeoutExceptionMessageIsNonEmptyTestStopAfterDisposeIsSilentTestConcurrentStopAndInvokeNoDeadlock Stop(TimeSpan) stops a running command within the boundOriginal Stop() overload still worksStop(TimeSpan) after Dispose is silent 02-stop-timeout-overload06-concurrent-stop-and-invoke
REQ-06 TestRunspaceCloseStopsPipelinesWithinBoundTestRunspaceCloseMultiplePipelinesCompletesInBound 3 active pipelines all close within 120s deadline 03-dispose-while-running05-runspace-close-with-pipeline
REQ-07 05-runspace-close-with-pipeline
REQ-08 TestDisposeWithRunningPipelineDoesNotHangTestStopAfterDisposeIsSilent Dispose with active pipeline completes within 60s 03-dispose-while-running04-double-dispose
REQ-09 TestRunspaceRemainsUsableAfterInvokeTimeout Runspace is usable after Invoke() TimeoutException 01-basic-timeout08-nested-timeout
REQ-10 TestNestedPSTimeoutPropagates 08-nested-timeout
02

Test Files

20 xUnit C# facts in PSTests.Sequential.TimeoutTests. Covers REQ-01 through REQ-10. Uses isolated runspaces to avoid contaminating shared fixtures.

417 lines

15 Pester 5 tests across 6 Contexts. Covers public API surface, edge cases, and longer-running timing tests tagged as "Feature".

277 lines
03

Adversarial Scenarios

8 hand-written PowerShell scripts that try to exercise failure modes, races, and edge cases. Each runs against the patched pwsh.exe binary.