Skip to content

Commit

Permalink
Merge pull request cockroachdb#20656 from BramGruneir/logictest2
Browse files Browse the repository at this point in the history
sql/logictest: don't keep processing the test file after a fatal subtest
  • Loading branch information
BramGruneir authored Dec 12, 2017
2 parents 4afe80e + 3487ae5 commit f2a7793
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/sql/logictest/logic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,9 @@ func (t *logicTest) processTestFile(path string, config testClusterConfig) error

repeat := 1
subtestName := "base"
tooManyErrors := false
s := newLineScanner(file, t.varMap)
for s.Scan() {
for !tooManyErrors && s.Scan() {
// Since the subtest also has a for s.Scan, don't double scan which would
// amount to skipping this line.
dontScanFirstLine := true
Expand All @@ -994,6 +995,7 @@ func (t *logicTest) processTestFile(path string, config testClusterConfig) error
for dontScanFirstLine || s.Scan() {
dontScanFirstLine = false
if *maxErrs > 0 && t.failures >= *maxErrs {
tooManyErrors = true
subtestT.Fatalf("%s:%d: too many errors encountered, skipping the rest of the input",
path, s.line)
}
Expand Down

0 comments on commit f2a7793

Please sign in to comment.