From 6a72c81f0cad92ed1522cf027cb4648b5f21c884 Mon Sep 17 00:00:00 2001 From: Goran Obradovic Date: Fri, 6 Sep 2024 10:58:14 +0200 Subject: [PATCH] Increase margin of error for Stopwatch based on measurements (#385) 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 --- .../ServicePartitionClientTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittests/Microsoft.ServiceFabric.Services.Tests/ServicePartitionClientTests.cs b/test/unittests/Microsoft.ServiceFabric.Services.Tests/ServicePartitionClientTests.cs index 7df8d054..ae4325d2 100644 --- a/test/unittests/Microsoft.ServiceFabric.Services.Tests/ServicePartitionClientTests.cs +++ b/test/unittests/Microsoft.ServiceFabric.Services.Tests/ServicePartitionClientTests.cs @@ -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; /// /// Tests handling of cancellation by the passed cancellation token.