Search in sources :

Example 11 with UserException

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."));
}
Also used : UserException(org.apache.drill.common.exceptions.UserException) Test(org.junit.Test) DrillTest(org.apache.drill.test.DrillTest)

Aggregations

UserException (org.apache.drill.common.exceptions.UserException)11 Stopwatch (com.google.common.base.Stopwatch)3 IOException (java.io.IOException)2 DrillRuntimeException (org.apache.drill.common.exceptions.DrillRuntimeException)2 ExecutionSetupException (org.apache.drill.common.exceptions.ExecutionSetupException)2 SchemaChangeException (org.apache.drill.exec.exception.SchemaChangeException)2 Test (org.junit.Test)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 DBDocumentReaderBase (com.mapr.db.ojai.DBDocumentReaderBase)1 DrillBuf (io.netty.buffer.DrillBuf)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 RelDataType (org.apache.calcite.rel.type.RelDataType)1 RelDataTypeFactory (org.apache.calcite.rel.type.RelDataTypeFactory)1 RexBuilder (org.apache.calcite.rex.RexBuilder)1 RexFieldCollation (org.apache.calcite.rex.RexFieldCollation)1 RexNode (org.apache.calcite.rex.RexNode)1 SqlOperator (org.apache.calcite.sql.SqlOperator)1 SqlTypeFactoryImpl (org.apache.calcite.sql.type.SqlTypeFactoryImpl)1