Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
135133: sqlccl: improve TestExplainGist a bit r=yuzefovich a=yuzefovich

This commit adjusts `TestExplainGist` so that it uses the production behavior of the panic catcher in the vectorized engine. This will allow us to not crash in case we hit one of the known bugs (we have an allow-list of internal errors that are silently swallowed, and all others will result in a test failure anyway).

Fixes: cockroachdb#134766.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Nov 15, 2024
2 parents 69fbd56 + 50bbd5a commit bf37c6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/testccl/sqlccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ go_test(
"//pkg/sql",
"//pkg/sql/catalog/lease",
"//pkg/sql/catalog/replication",
"//pkg/sql/colexecerror",
"//pkg/sql/gcjob",
"//pkg/sql/isql",
"//pkg/sql/lexbase",
Expand Down
6 changes: 6 additions & 0 deletions pkg/ccl/testccl/sqlccl/explain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/internal/sqlsmith"
"github.com/cockroachdb/cockroach/pkg/sql/colexecerror"
"github.com/cockroachdb/cockroach/pkg/sql/lexbase"
"github.com/cockroachdb/cockroach/pkg/sql/sqltestutils"
"github.com/cockroachdb/cockroach/pkg/sql/tests"
Expand Down Expand Up @@ -137,6 +138,11 @@ func TestExplainGist(t *testing.T) {
skip.UnderDeadlock(t, "the test is too slow")
skip.UnderRace(t, "the test is too slow")

// Use the release-build panic-catching behavior instead of the
// crdb_test-build behavior. This is needed so that some known bugs like
// #117101 don't result in a test failure.
defer colexecerror.ProductionBehaviorForTests()()

ctx := context.Background()
rng, _ := randutil.NewTestRand()

Expand Down

0 comments on commit bf37c6b

Please sign in to comment.