-
Notifications
You must be signed in to change notification settings - Fork 625
Closed
Description
Test Failure: junit.framework.TestSuite.io.openliberty.jakarta.enterprise.concurrent.tck.ConcurrentTckLauncherWeb:
io.openliberty.jakarta.enterprise.concurrent.tck.ConcurrentTckLauncherWeb:java.lang.Exception: Errors/warnings were found in server ConcurrentTCKWebServer logs:
<br>[12/17/25, 0:14:35:982 UTC] 000000a4 com.ibm.ws.concurrent.internal.ScheduledTask E CWWKC1101E: The task ee.jakarta.tck.concurrent.common.counter.CounterRunnableTask@926a528c, which was submitted to executor service managedScheduledExecutorService[DefaultManagedScheduledExecutorService], failed with the following error: java.lang.RuntimeException: java.lang.InterruptedException
at componenttest.topology.impl.LibertyServer.checkLogsForErrorsAndWarnings(LibertyServer.java:3521)
at componenttest.topology.impl.LibertyServer.stopServer(LibertyServer.java:3342)
at componenttest.topology.impl.LibertyServer.stopServer(LibertyServer.java:3179)
at componenttest.topology.impl.LibertyServer.stopServer(LibertyServer.java:3173)
at componenttest.topology.impl.LibertyServer.stopServer(LibertyServer.java:3149)
at componenttest.topology.impl.LibertyServer.stopServer(LibertyServer.java:3058)
at componenttest.topology.impl.LibertyServer.stopServer(LibertyServer.java:3033)
at io.openliberty.jakarta.enterprise.concurrent.tck.ConcurrentTckLauncherWeb.tearDown(ConcurrentTckLauncherWeb.java:67)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at componenttest.custom.junit.runner.FATRunner$2.evaluate(FATRunner.java:412)
at componenttest.custom.junit.runner.FATRunner.run(FATRunner.java:204)
The TCK test passes despite the logged error,
[12/17/25, 0:14:20:830 UTC] 0000009a ee.jakarta.tck.concurrent.framework.ArquillianTests I --> testApiScheduleWithFixedDelay
[ testApiScheduleWithFixedDelay ]
[12/17/25, 0:14:35:982 UTC] 000000a4 com.ibm.ws.concurrent.internal.ScheduledTask E CWWKC1101E: The task ee.jakarta.tck.concurrent.common.counter.CounterRunnableTask@926a528c, which was submitted to executor service managedScheduledExecutorService[DefaultManagedScheduledExecutorService], failed with the following error: java.lang.RuntimeException: java.lang.InterruptedException
at ee.jakarta.tck.concurrent.common.counter.CounterRunnableTask.run(CounterRunnableTask.java:50)
at com.ibm.ws.concurrent.internal.ScheduledTask.call(ScheduledTask.java:452)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:344)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:853)
Caused by: java.lang.InterruptedException
at java.base/java.lang.Thread.sleepImpl(Native Method)
at java.base/java.lang.Thread.sleep(Thread.java:1005)
at java.base/java.lang.Thread.sleep(Thread.java:988)
at ee.jakarta.tck.concurrent.framework.TestUtil.sleep(TestUtil.java:179)
at ee.jakarta.tck.concurrent.common.counter.CounterRunnableTask.run(CounterRunnableTask.java:42)
... 6 more
.
[12/17/25, 0:14:36:983 UTC] 0000009a ee.jakarta.tck.concurrent.framework.ArquillianTests I <-- testApiScheduleWithFixedDelay
[ null ]
[12/17/25, 0:14:36:984 UTC] 0000009a com.ibm.ws.fat.util.tck.TestLoggingObserver I Test complete: InheritedAPIWebTests.testApiScheduleWithFixedDelay
The test code schedules a repeating task and cancels it,
public void testApiScheduleWithFixedDelay() {
ScheduledFuture<?> result = null;
try {
EJBJNDIProvider nameProvider = ServiceLoader.load(EJBJNDIProvider.class).findFirst().orElseThrow();
result = scheduledExecutor.scheduleWithFixedDelay(
new CounterRunnableTask(nameProvider.getEJBJNDIName(), TestConstants.pollInterval), // task
TestConstants.pollInterval.getSeconds(), // initial delay
TestConstants.pollInterval.getSeconds(), // delay
TimeUnit.SECONDS); // Time units
Wait.sleep(TestConstants.waitTimeout);
Assertions.assertBetween(counter.getCount(), (TestConstants.pollsPerTimeout / 2) - 2,
(TestConstants.pollsPerTimeout / 2) + 2);
} catch (Exception e) {
fail(e.getMessage());
} finally {
if (result != null) {
Wait.waitCancelFuture(result);
}
counter.reset();
}
}
If the task happens to be running and is in the middle of its sleep operation when cancelled, the sleep operation will be interrupted, in which case the CounterRunnableTask chooses to raise a RuntimeException chaining the InterrruptedException, which Liberty rightly logs a message for.
public void run() {
try {
if (!sleepTime.isZero()) {
Wait.sleep(sleepTime);
}
CounterInterface counter = InitialContext.doLookup(countSingletionJndi);
counter.inc();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
If the test case is going to do this, then it needs to tolerate the warning in the logs.