File tree Expand file tree Collapse file tree
ejb/timer/src/test/java/org/javaee7/ejb/timer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525public 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}
You can’t perform that action at this time.
0 commit comments