presto-verifier/src/main/java/io/prestosql/verifier/Validator.java/Validator/executePreAndMain
class Validator:    private QueryResult executePreAndMain(
            Query query,
            List<QueryResult> preQueryResults,
            String gateway,
            String username,
            String password,
            Duration timeout,
            List<QueryResult> postQueryResults,
            int teardownRetries)
    {
        try {
            // startup
            QueryResult queryResult = setup(query, preQueryResults, preQuery ->
                    executeQuery(gateway, username, password, query, preQuery, timeout, sessionProperties));

            // if startup is successful -> execute query
            if (queryResult.getState() == State.SUCCESS) {
                queryResult = executeQuery(gateway, username, password, query, query.getQuery(), timeout, sessionProperties);
            }

            return queryResult;
        }
        catch (Exception e) {
            executeTearDown(query, gateway, username, password, timeout, postQueryResults, teardownRetries);
            throw e;
        }
    }