Skip to content

Commit

Permalink
Increase margin of error for Stopwatch based on measurements (#385)
Browse files Browse the repository at this point in the history
ServicePartitionClientTests are flaky due to documented imprecision of
Stopwatch class.
Based on empirical measurements, we're increasing margin of error from
10ms to 25ms.

Internal ADO work item:
https://dev.azure.com/msazure/One/_workitems/edit/29276368
  • Loading branch information
gobradovic authored Sep 6, 2024
1 parent a09ce87 commit 6a72c81
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ServicePartitionClientTests
// Due to bugs in BIOS or Hardware Abstraction Layer, Stopwatch sometimes reports slightly smaller value, as
// documented here: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stopwatch?view=net-8.0
// We need to account for that possibility.
private static readonly long StopwatchPrecisionMs = 10;
private static readonly long StopwatchPrecisionMs = 25;

/// <summary>
/// Tests handling of cancellation by the passed cancellation token.
Expand Down

0 comments on commit 6a72c81

Please sign in to comment.