Skip to content

Commit df60ceb

Browse files
committed
Improve test
1 parent f94e4bc commit df60ceb

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Cake.Issues.Tests/IssueReaderTests.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,13 @@ public void Should_Demonstrate_Parallel_Processing_Benefits_With_Simulated_Delay
468468
var expectedSequentialTime = providerCount * delayPerProviderMs;
469469
var actualTime = stopwatch.ElapsedMilliseconds;
470470

471-
// Allow for some overhead but expect significant improvement
472-
var maxExpectedParallelTime = expectedSequentialTime * 0.4; // Should be much faster than 40% of sequential time
473-
474-
System.Console.WriteLine($"Sequential time would be ~{expectedSequentialTime}ms, parallel time was {actualTime}ms");
471+
Console.WriteLine($"Sequential time would be ~{expectedSequentialTime}ms, parallel time was {actualTime}ms");
472+
actualTime.ShouldBeLessThan(expectedSequentialTime, "Parallel reading of issue providers is slower than sequential processing would be");
475473

476474
// This assertion may be flaky in CI environments, so we'll use a generous threshold
477-
actualTime.ShouldBeLessThan(expectedSequentialTime);
478-
// Verify all issues have correct properties set
479-
// The Run property should be set to the same value from settings (even if null)
480-
issues.ShouldAllBe(x => x.Run == fixture.Settings.Run);
475+
// Should be much faster than 40% of sequential time
476+
var maxExpectedParallelTime = expectedSequentialTime * 0.4;
477+
Convert.ToDouble(actualTime).ShouldBeLessThan(maxExpectedParallelTime, "Parallel reading of issue providers is more than 40% of time it took for sequential processing");
481478
}
482479
}
483480
}

0 commit comments

Comments
 (0)