Improve exception handling in BasePlanTest
@@ -39,7 +39,6 @@ import static com.facebook.presto.testing.TestingSession.testSessionBuilder;
import static io.airlift.testing.Closeables.closeAllRuntimeException;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
-import static org.testng.Assert.fail;
public class BasePlanTest
{
@@ -155,9 +154,8 @@ public class BasePlanTest
try {
return queryRunner.inTransaction(transactionSession -> queryRunner.createPlan(transactionSession, sql, stage, forceSingleNode));
}
- catch (RuntimeException ex) {
- fail("Invalid SQL: " + sql, ex);
- return null; // make compiler happy
+ catch (RuntimeException e) {
+ throw new AssertionError("Planning failed for SQL: " + sql, e);
}
}
}
