[infinispan-issues] [JBoss JIRA] (ISPN-2451) DefaultExecutorService invokeAny(Collection tasks, long timeout, TimeUnit unit) waits till the task execution even if the timeout exceeds
Mircea Markus (JIRA)
jira-events at lists.jboss.org
Wed Oct 31 07:43:02 EDT 2012
[ https://issues.jboss.org/browse/ISPN-2451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mircea Markus updated ISPN-2451:
--------------------------------
Fix Version/s: 5.2.0.CR1
5.2.0.Final
> DefaultExecutorService invokeAny(Collection tasks, long timeout, TimeUnit unit) waits till the task execution even if the timeout exceeds
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-2451
> URL: https://issues.jboss.org/browse/ISPN-2451
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 5.1.8.Final
> Reporter: Anna Manukyan
> Assignee: Vladimir Blagojevic
> Fix For: 5.2.0.CR1, 5.2.0.Final
>
> Attachments: DistributedExecutorTest.java
>
>
> Hi,
> I've written some new tests for DefaultExecutorService for both testing the product as well as for increasing the coverage and I have some strange behaviour which I don't know whether related to concurency non-reliability or it is a bug.
> I have a Callable which just sleeps for 10 seconds and the returns 1. And I have a test, which submits the callable to DefaultExecutorService with invokeAny(collection, timeout, TimeUnit) method, and passes as a parameter to the method 2 seconds. As far as I understand, this means that if the execution of any of the tasks will not complete in 2 seconds, the Timeout exception should be thrown.
> But everytime I run the test, the TimeoutException is thrown only once maybe in 5 executions. The exception is:
> org.testng.TestException:
> Expected exception java.util.concurrent.TimeoutException but got org.testng.TestException:
> Method org.infinispan.distexec.DistributedExecutorTest.testInvokeAnyTimedSleepingTasks() should have thrown an exception of class java.util.concurrent.TimeoutException
> at org.testng.internal.Invoker.handleInvocationResults(Invoker.java:1416)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1184)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
> at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
> at org.testng.TestRunner.privateRun(TestRunner.java:749)
> at org.testng.TestRunner.run(TestRunner.java:600)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
> at org.testng.SuiteRunner.access$000(SuiteRunner.java:34)
> at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:351)
> at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:147)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: org.testng.TestException:
> Method org.infinispan.distexec.DistributedExecutorTest.testInvokeAnyTimedSleepingTasks() should have thrown an exception of class java.util.concurrent.TimeoutException
> at org.testng.internal.Invoker.handleInvocationResults(Invoker.java:1442)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:722)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170)
> ... 12 more
> You can find the test attached, the test case is: testInvokeAnyTimedSleepingTasks() .
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list