Re: 回复: ThreadExecutorTest.testInvokeAnyInterrupt1 random failure(Internet mail)

Alan Bateman Alan.Bateman at oracle.com
Fri Aug 28 07:02:25 UTC 2020


On 28/08/2020 02:56, kalinshi(施慧) wrote:
> Thanks for pointing out reason why if fail with AbstractExecutorService.doInvokeAny!
>
> Got random failure when replacing scheduler, previous I was assume ExecutorServices's behavior is same for invokeAny method.
> Regards!
> Hui
>
Okay although I don't think this is anything to do with the scheduler. 
Instead, it's about the behavior of invokeAny when invoked with the 
interrupt status set and where one or more of the tasks complete 
immediately so there isn't any waiting. The test assumes that 
InterruptedException is thrown so it will fail intermittently if it 
being used to test a different ExecutorService implementation. We can 
fix that of course but I'm curious how you ran into it.

-Alan



More information about the loom-dev mailing list