Skip to content

Commit b7db31f

Browse files
committed
widen tolerance in order to handle slow machines
1 parent ea0ef57 commit b7db31f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jpos/src/test/java/org/jpos/util/TPSTestCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ public void test1000TPSAutoUpdate() throws Exception {
3737
Instant nowDone = Instant.now();
3838
sleepAtLeast(1100L - Duration.between(nowInit, Instant.now()).toMillis()); // scheduler is not perfectly accurate
3939
int measured = awaitAutoValue(tps, Duration.ofSeconds(2));
40-
assertInRange(measured, 900, 1100, "Expected around 1000 TPS");
41-
assertInRange(measured, 900, 1100, "Still expecting around 1000 TPS on a second call");
40+
assertInRange(measured, 850, 1100, "Expected around 1000 TPS");
41+
assertInRange(measured, 850, 1100, "Still expecting around 1000 TPS on a second call");
4242
sleepAtLeast(2100L - Duration.between(nowDone, Instant.now()).toMillis());
4343
assertTrue(tps.getAvg() >= 0.5, "Average should be aprox 0.5 but it's " + tps.getAvg());
4444
sleepAtLeast(3100L - Duration.between(nowDone, Instant.now()).toMillis());
4545
assertEquals(
4646
0, tps.intValue(),
4747
"TPS should be zero but it's " + tps.intValue() + " (" + tps.floatValue() + ")"
4848
);
49-
assertInRange(tps.getPeak(), 900, 1100, "Peak should be around 1000");
49+
assertInRange(tps.getPeak(), 850, 1100, "Peak should be around 1000");
5050
tps.stop();
5151
}
5252
@Test

0 commit comments

Comments
 (0)