You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: timing-based test assertions are inherently flaky #4876
Several tests verify parallel/non-parallel execution by checking DateTime overlaps, which are inherently fragile:
ParallelTests.cs and NotInParallelTests.cs
Use DateTimeRange overlaps to verify parallel/sequential execution. DateTime precision depends on system clock granularity. On slow CI systems, tests might complete too quickly for overlap detection.
TimeoutTests1.cs (Lines 18-19)
Tight timing assertion expecting test to complete between 4-60 seconds. Fragile on resource-constrained CI.
AdaptiveParallelismTests.cs
CPU-intensive loop using DateTime.UtcNow comparisons (system clock dependent). 1000 repetitions × 1s delay = 16+ minutes per test method.
Suggested Fix
Replace DateTime overlap checks with Interlocked concurrent execution counters
Use event-based synchronization (TaskCompletionSource) instead of hard timeouts
Widen timing windows with documented rationale
Separate AdaptiveParallelismTests into a [Category("Performance")] suite
Activity
github-actions commentedon Mar 21, 2026
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
github-actions commentedon Mar 26, 2026
This issue was closed because it has been stalled for 5 days with no activity.