Skip to content

Commit 69d0436

Browse files
committed
Increased tolerance/timeout for EJB timer test
1 parent a12ee74 commit 69d0436

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

ejb/timer/src/test/java/org/javaee7/ejb/timer/MultipleScheduleTimerBeanTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public class MultipleScheduleTimerBeanTest {
2626

2727
private static final long TIMEOUT = 0l;
28-
private static final long TOLERANCE = 1000l;
28+
private static final long TOLERANCE = 4000l;
2929

3030
@Inject
3131
private PingsListener pings;
@@ -47,14 +47,15 @@ public void should_receive_three_pings() {
4747
Ping secondPing = pings.getPings().get(1);
4848
Ping thirdPing = pings.getPings().get(2);
4949

50-
long delay = secondPing.getTime() - firstPing.getTime();
51-
System.out.println("Actual timeout = " + delay);
50+
long timeBetweenFirstAndSecondPing = secondPing.getTime() - firstPing.getTime();
51+
System.out.println("Actual timeout = " + timeBetweenFirstAndSecondPing);
5252

53-
long delay2 = thirdPing.getTime() - secondPing.getTime();
54-
System.out.println("Actual timeout = " + delay2);
53+
long timeBetweenSecondAndThirdPing = thirdPing.getTime() - secondPing.getTime();
54+
System.out.println("Actual timeout = " + timeBetweenSecondAndThirdPing);
5555

56-
long smallerDelay = min(delay, delay2);
56+
long smallerDelay = min(timeBetweenFirstAndSecondPing, timeBetweenSecondAndThirdPing);
5757

58+
// Note; this is quite sensitive to slow CI systems.
5859
assertThat(smallerDelay, is(withinWindow(TIMEOUT, TOLERANCE)));
5960
}
6061
}

0 commit comments

Comments
 (0)