[
https://issues.apache.org/jira/browse/TEZ-3695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15981184#comment-15981184
]
Jason Lowe commented on TEZ-3695:
---------------------------------
Looks like the test has an inherent race in it:
{code}
List<Integer> list = new ArrayList<>();
Future<?> f1 = service.submit(new Wait(list));
List<Future<?>> futures = new ArrayList<>();
for (int i = 0; i < 10; ++i) {
futures.add(service.submit(new Appender<Integer>(list, i)));
}
// This shutdown does not prevent already submitted tasks from completing.
service.shutdown();
// Until we notify nothing moves forward.
Assert.assertEquals(0, list.size());
_notify(list);
f1.get();
{code}
The code assumes that the executor will be fast enough to get to the {{wait}}
in the {{Wait}} code before the main test code tries to do the {{notify}} to
wake it up. However if the executor is a little slower then the main code will
trigger the {{notify}} _before_ any code is waiting and then we end up with an
indefinite wait and test timeout.
The test should be using something like a {{CountdownLatch}} to coordinate
between the {{Wait}} code and main test code.
> TestTezSharedExecutor fails sporadically
> ----------------------------------------
>
> Key: TEZ-3695
> URL: https://issues.apache.org/jira/browse/TEZ-3695
> Project: Apache Tez
> Issue Type: Bug
> Reporter: Jason Lowe
>
> TestTezSharedExecutor#testSerialExecution is timing out more often than not
> for me when running the full TezTezSharedExecutor test suite.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)