Skip to content

Commit bf54f01

Browse files
Fix flakiness in ThreadingDiagnoserTests
1 parent bbc4b45 commit bf54f01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/BenchmarkDotNet.IntegrationTests/ThreadingDiagnoserTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ private void AssertStats(Summary summary, Dictionary<string, (string metricName,
155155

156156
var metric = selectedReport.Metrics.Single(m => m.Key == assertion.Value.metricName);
157157

158-
// precision is set to 3 because CoreCLR might schedule some work item on it's own and hence affect the results..
159-
Assert.Equal(assertion.Value.expectedValue, metric.Value.Value, precision: 3);
158+
// precision is set to 2 because CoreCLR might schedule some work item on it's own and hence affect the results..
159+
// precision = 3 is not enough (e.g., sometimes the actual value may be equal 1.0009765625 while the expected value is 1.0)
160+
Assert.Equal(assertion.Value.expectedValue, metric.Value.Value, precision: 2);
160161
}
161162
}
162163
}

0 commit comments

Comments
 (0)