You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dev/com.ibm.ws.concurrent_fat/test-applications/concurrentSpec/src/fat/concurrent/spec/app/EEConcurrencyTestServlet.java
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -9389,27 +9389,27 @@ public void testUnitConversions() throws Exception {
9389
9389
ScheduledFuture<?> future1 = schedxsvcDefault.schedule((Runnable) new CounterTask(), 1000000, TimeUnit.DAYS);
9390
9390
try {
9391
9391
long days = future1.getDelay(TimeUnit.DAYS);
9392
-
if (days != 106751l) // maximum possible due to limiations of java.util.concurrent.TimeUnit
9392
+
if (days > 1000000l || days < 106751l) // maximum possible due to limitations of java.util.concurrent.TimeUnit
9393
9393
throw new Exception("Task1: Unexpected delay in days: " + days);
9394
9394
9395
9395
long hours = future1.getDelay(TimeUnit.HOURS);
9396
-
if (hours != 2562047l)
9396
+
if (hours > 24000000l || hours < 2562047l)
9397
9397
throw new Exception("Task1: Unexpected delay in hours: " + hours);
9398
9398
9399
9399
long minutes = future1.getDelay(TimeUnit.MINUTES);
9400
-
if (minutes != 153722867l)
9400
+
if (minutes > 1440000000l || minutes < 153722867l)
9401
9401
throw new Exception("Task1: Unexpected delay in minutes: " + minutes);
9402
9402
9403
9403
long seconds = future1.getDelay(TimeUnit.SECONDS); // expecting 9223372036, but allow for additional time that might have elapsed
9404
-
if (seconds < 9223372030l || seconds > 9223372036l)
9404
+
if (seconds > 86400000000l || seconds < 9223372030l)
9405
9405
throw new Exception("Task1: Unexpected delay in seconds: " + seconds);
9406
9406
9407
9407
long millis = future1.getDelay(TimeUnit.MILLISECONDS);
9408
-
if (millis < 9223372030000l || millis > 9223372038000l)
9408
+
if (millis > 86400000000000l || millis < 9223372030000l)
9409
9409
throw new Exception("Task1: Unexpected delay in milliseconds: " + millis);
9410
9410
9411
9411
long micros = future1.getDelay(TimeUnit.MICROSECONDS);
9412
-
if (micros < 9223372030000000l || micros > 9223372038000000l)
9412
+
if (micros > 86400000000000000l || micros < 9223372030000000l)
9413
9413
throw new Exception("Task1: Unexpected delay in microseconds: " + micros);
9414
9414
9415
9415
long nanos = future1.getDelay(TimeUnit.NANOSECONDS);
@@ -9424,15 +9424,15 @@ public void testUnitConversions() throws Exception {
9424
9424
throw new Exception("Task2: Unexpected delay in seconds: " + days);
9425
9425
9426
9426
minutes = future2.getDelay(TimeUnit.MINUTES);
9427
-
if (minutes != 153722866l)
9427
+
if (minutes > 153722867l || minutes < 153722866l) // allow for rounding up or down
9428
9428
throw new Exception("Task2: Unexpected delay in minutes: " + minutes);
9429
9429
9430
9430
hours = future2.getDelay(TimeUnit.HOURS);
9431
-
if (hours != 2562047l)
9431
+
if (hours > 2562048l || hours < 2562047l)
9432
9432
throw new Exception("Task2: Unexpected delay in hours: " + hours);
9433
9433
9434
9434
days = future1.getDelay(TimeUnit.DAYS);
9435
-
if (days != 106751l)
9435
+
if (days > 106752l || days < 106751l)
9436
9436
throw new Exception("Task1: Unexpected delay in days: " + days);
9437
9437
9438
9438
int result = future1.compareTo(future2);
@@ -9446,7 +9446,7 @@ public void testUnitConversions() throws Exception {
9446
9446
}
9447
9447
9448
9448
long days = future1.getDelay(TimeUnit.DAYS);
9449
-
if (days != 106751l)
9449
+
if (days > 106752l || days < 106751l)
9450
9450
throw new Exception("Delay should remain unchanged after canceling task in order to be consistent with java.util.concurrent.ScheduledThreadPoolExecutor. Instead: "
0 commit comments