Skip to content

Commit 3d904c2

Browse files
Clint Checkettsbrian-brazil
authored andcommitted
Increase allowed test delta for timings
1 parent fce9c02 commit 3d904c2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

simpleclient_spring_web/src/test/java/io/prometheus/client/spring/web/MethodTimerTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void timeMethod() throws Exception {
4040

4141
final Double tot = CollectorRegistry.defaultRegistry.getSampleValue("test_class_sum");
4242
Assert.assertNotNull(tot);
43-
assertEquals(0.02, tot, 0.001);
43+
assertEquals(0.02, tot, 0.01);
4444
}
4545

4646
<T> T getProxy(T source){
@@ -68,13 +68,13 @@ public void aSecondMethod() throws Exception {
6868
a.timeMe();
6969

7070
final Double tot = CollectorRegistry.defaultRegistry.getSampleValue(name + "_sum");
71-
assertEquals(0.035, tot,0.001);
71+
assertEquals(0.035, tot,0.01);
7272

7373
a.timeMe();
7474
a.timeMe();
7575
a.timeMe();
7676
final Double tot2 = CollectorRegistry.defaultRegistry.getSampleValue(name + "_sum");
77-
assertEquals(0.035*4, tot2, 0.008);
77+
assertEquals(0.035*4, tot2, 0.1);
7878
}
7979

8080
@Test
@@ -173,7 +173,7 @@ public void aSecondMethod() throws Exception {
173173
final Double total = CollectorRegistry.defaultRegistry.getSampleValue("second_method_name_seconds_sum");
174174

175175
assertNotNull(total);
176-
assertEquals(0.001*count*sleepTime, total, 0.01);
176+
assertEquals(0.001*count*sleepTime, total, 0.1);
177177

178178
assertNotNull(misnamedTotal);
179179
assertEquals(0.001*misnamedSleepTime, misnamedTotal, 0.01);
@@ -208,7 +208,7 @@ public void doSomething(String s) throws Exception {
208208
final Double tot1 = CollectorRegistry.defaultRegistry.getSampleValue("dosomething_one_test_seconds_sum");
209209
final Double tot2 = CollectorRegistry.defaultRegistry.getSampleValue("dosomething_two_test_seconds_sum");
210210

211-
assertEquals(.001*sleep2, tot2,.001);
212-
assertEquals(.001*sleep1, tot1, .001);
211+
assertEquals(.001*sleep2, tot2,.01);
212+
assertEquals(.001*sleep1, tot1, .01);
213213
}
214-
}
214+
}

0 commit comments

Comments
 (0)