use of org.apache.drill.common.exceptions.UserException in project drill by apache.
the class TestTimedRunnable method withTasksExceedingTimeout.
@Test
public void withTasksExceedingTimeout() throws Exception {
UserException ex = null;
try {
List<TimedRunnable<TestTask>> tasks = Lists.newArrayList();
for (int i = 0; i < 100; i++) {
if ((i & (i + 1)) == 0) {
tasks.add(new TestTask(2000));
} else {
tasks.add(new TestTask(20000));
}
}
TimedRunnable.run("Execution with some tasks triggering timeout", logger, tasks, 16);
} catch (UserException e) {
ex = e;
}
assertNotNull("Expected a UserException", ex);
assertThat(ex.getMessage(), containsString("Waited for 93750ms, but tasks for 'Execution with some tasks triggering timeout' are not " + "complete. Total runnable size 100, parallelism 16."));
}
Aggregations