Skip to content

Commit ed797dd

Browse files
committed
sql/logictest: skip remainder of test on snappy infra flake
When the cockroach-go/testserver-based logic tests hit the known "Can't find decompressor for snappy" infra flake (#124966) during a mixed-version test, handleWaitForInitErr stops the testserver cluster and skips the current subtest. However, only the *current* subtest is skipped; the parent test loop continues and the next subtest (e.g. post_upgrade) calls into the dead testserver cluster, failing with "os: process already finished" so that the overall test reports FAIL instead of SKIP. Add a sticky skippedDueToSnappy flag to logicTest, set it alongside the existing ts.Stop() in handleWaitForInitErr, and check it in the processTestFile subtest loop to break out and mark the parent test skipped (preserving real failures with a !rootT.Failed() guard). Also nil out testserverCluster so any stray code path trips the existing nil guard cleanly. Resolves: #168412 Epic: none Release note: None
1 parent f7c6490 commit ed797dd

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

pkg/sql/logictest/logic.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,13 @@ type logicTest struct {
11011101
skipOnRetry bool
11021102
skippedOnRetry bool
11031103

1104+
// skippedDueToSnappy is sticky once set: it indicates that the
1105+
// "Can't find decompressor for snappy" infra flake was detected
1106+
// (#124966), the testserver cluster has been stopped, and the
1107+
// remainder of the test should be skipped rather than run further
1108+
// directives against the dead cluster.
1109+
skippedDueToSnappy bool
1110+
11041111
// declarativeCorpusCollector used to save declarative schema changer state
11051112
// to disk.
11061113
declarativeCorpusCollector *corpus.Collector
@@ -1438,6 +1445,8 @@ func (t *logicTest) handleWaitForInitErr(ts testserver.TestServer, err error) {
14381445
if ts != nil {
14391446
ts.Stop()
14401447
}
1448+
t.skippedDueToSnappy = true
1449+
t.testserverCluster = nil
14411450
t.t().Skip("ignoring init did not finish for node error due to snappy error")
14421451
}
14431452
}
@@ -2313,6 +2322,9 @@ func (t *logicTest) processTestFile(path string, config logictestbase.TestCluste
23132322
if *maxErrs > 0 && t.failures >= *maxErrs {
23142323
break
23152324
}
2325+
if t.skippedDueToSnappy {
2326+
break
2327+
}
23162328
// If subtest has no name, then it is not a subtest, so just run the lines
23172329
// in the overall test. Note that this can only happen in the first subtest.
23182330
if len(subtest.name) == 0 {
@@ -2333,6 +2345,10 @@ func (t *logicTest) processTestFile(path string, config logictestbase.TestCluste
23332345
t.maybeSkipOnRetry(nil)
23342346
}
23352347
}
2348+
if t.skippedDueToSnappy && !t.rootT.Failed() {
2349+
skip.IgnoreLintf(t.rootT,
2350+
"skipping remainder of test due to snappy infra flake; see #124966")
2351+
}
23362352

23372353
if (*rewriteResultsInTestfiles || *rewriteSQL) && !t.rootT.Failed() {
23382354
// Rewrite the test file.

0 commit comments

Comments
 (0)