Skip to content

Commit

Permalink
roachtest: fail tpcdsvec test with an error
Browse files Browse the repository at this point in the history
In `tpcdsvec` test we run all the queries even we hit an error.
Previously if an error occurred, we would just fail the test, and now we
will be failing with an error that is a "combination" of all occurred
errors.

Release note: None
  • Loading branch information
yuzefovich committed Apr 27, 2020
1 parent 4b119a9 commit c0a483d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/cmd/roachtest/tpcdsvec.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/cmd/cmpconn"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/cockroach/pkg/workload/tpcds"
"github.com/cockroachdb/errors"
)

func registerTPCDSVec(r *testRegistry) {
Expand Down Expand Up @@ -149,7 +150,7 @@ func registerTPCDSVec(r *testRegistry) {
}

noStatsRunTimes := make(map[int]float64)
encounteredErrors := false
var errToReport error
// We will run all queries in two scenarios: without stats and with
// auto stats. The idea is that the plans are likely to be different,
// so we will be testing different execution scenarios. We additionally
Expand All @@ -175,7 +176,7 @@ func registerTPCDSVec(r *testRegistry) {
ctx, 3*timeout, conns, "", query, false, /* ignoreSQLErrors */
); err != nil {
t.Status(fmt.Sprintf("encountered an error: %s\n", err))
encounteredErrors = true
errToReport = errors.CombineErrors(errToReport, err)
} else {
runTimeInSeconds := timeutil.Since(start).Seconds()
t.Status(
Expand All @@ -198,8 +199,8 @@ func registerTPCDSVec(r *testRegistry) {
createStatsFromTables(t, clusterConn, tpcdsTables)
}
}
if encounteredErrors {
t.FailNow()
if errToReport != nil {
t.Fatal(errToReport)
}
}

Expand Down

0 comments on commit c0a483d

Please sign in to comment.