Skip to content

Commit 6d59159

Browse files
committed
sql/inspect: skip flaky statement timeout test under race
The TestInspectJobImplicitTxnSemantics statement_timeout subtest was failing intermittently under race conditions. The test expects an INSPECT job to start and succeed even when the triggering EXPERIMENTAL SCRUB statement times out after 1 second, but on slow machines with race detection enabled, the job creation may not complete before the timeout. Fixes #153164 Release note: None Epic: None
1 parent dec7e21 commit 6d59159

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pkg/sql/inspect/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ go_test(
7979
"//pkg/sql/sessiondata",
8080
"//pkg/testutils",
8181
"//pkg/testutils/serverutils",
82+
"//pkg/testutils/skip",
8283
"//pkg/testutils/sqlutils",
8384
"//pkg/testutils/testcluster",
8485
"//pkg/util/leaktest",

pkg/sql/inspect/inspect_job_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/cockroachdb/cockroach/pkg/sql"
1717
"github.com/cockroachdb/cockroach/pkg/testutils"
1818
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
19+
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
1920
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
2021
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
2122
"github.com/cockroachdb/cockroach/pkg/util/log"
@@ -83,14 +84,18 @@ func TestInspectJobImplicitTxnSemantics(t *testing.T) {
8384
onStartError error
8485
expectedErrRegex string
8586
expectedJobStatus string
87+
skipUnderRace bool
8688
}{
8789
{desc: "inspect success", expectedJobStatus: "succeeded"},
8890
{desc: "inspect failure", onStartError: errors.Newf("inspect validation error"),
8991
expectedErrRegex: "inspect validation error", expectedJobStatus: "failed"},
9092
// Note: avoiding small statement timeouts, as this can impact the ability to reset.
9193
{desc: "statement timeout", setupSQL: "SET statement_timeout = '1s'", tearDownSQL: "RESET statement_timeout",
92-
pauseAtStart: true, expectedErrRegex: "canceled", expectedJobStatus: "succeeded"},
94+
pauseAtStart: true, expectedErrRegex: "canceled", expectedJobStatus: "succeeded", skipUnderRace: true},
9395
} {
96+
if tc.skipUnderRace {
97+
skip.UnderRace(t, "timing dependent")
98+
}
9499
t.Run(tc.desc, func(t *testing.T) {
95100
// Run in a closure so that we run teardown before verifying job status
96101
func() {

0 commit comments

Comments
 (0)