From c0a483de3a3c78897fb21bdd17139c17e5d8d413 Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Thu, 23 Apr 2020 07:35:33 -0700 Subject: [PATCH] roachtest: fail tpcdsvec test with an error 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 --- pkg/cmd/roachtest/tpcdsvec.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/roachtest/tpcdsvec.go b/pkg/cmd/roachtest/tpcdsvec.go index 72417cca17a0..6a98899e5d71 100644 --- a/pkg/cmd/roachtest/tpcdsvec.go +++ b/pkg/cmd/roachtest/tpcdsvec.go @@ -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) { @@ -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 @@ -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( @@ -198,8 +199,8 @@ func registerTPCDSVec(r *testRegistry) { createStatsFromTables(t, clusterConn, tpcdsTables) } } - if encounteredErrors { - t.FailNow() + if errToReport != nil { + t.Fatal(errToReport) } }