Skip to content

Commit

Permalink
Change verifier to skip queries that timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Jun 25, 2014
1 parent f01d2e0 commit 466f481
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class QueryResult
{
public enum State
{
INVALID, FAILED, SUCCESS, TOO_MANY_ROWS
INVALID, FAILED, SUCCESS, TOO_MANY_ROWS, TIMEOUT
}

private final State state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLTimeoutException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Comparator;
Expand Down Expand Up @@ -105,6 +104,10 @@ public Validator(VerifierConfig config, QueryPair queryPair)

public boolean isSkipped()
{
if (getControlResult().getState() == State.TIMEOUT || getTestResult().getState() == State.TIMEOUT) {
return true;
}

if (!checkCorrectness) {
return false;
}
Expand Down Expand Up @@ -139,6 +142,12 @@ else if (!isDeterministic()) {
sb.append("Schema (control): " + queryPair.getControl().getSchema() + "\n");
sb.append("NON DETERMINISTIC\n");
}
else if (getControlResult().getState() == State.TIMEOUT || getTestResult().getState() == State.TIMEOUT) {
sb.append("----------\n");
sb.append("Name: " + queryPair.getName() + "\n");
sb.append("Schema (control): " + queryPair.getControl().getSchema() + "\n");
sb.append("TIMEOUT\n");
}
return sb.toString();
}

Expand Down Expand Up @@ -246,7 +255,7 @@ private QueryResult executeQuery(String url, String username, String password, Q
throw e;
}
catch (UncheckedTimeoutException e) {
throw new SQLTimeoutException(e);
return new QueryResult(State.TIMEOUT, null, null, ImmutableList.<List<Object>>of());
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
Expand Down

0 comments on commit 466f481

Please sign in to comment.