Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql/logictest: don't keep processing the test file after a fatal subtest #20656

Merged
merged 1 commit into from
Dec 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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