Skip to content

Commit

Permalink
sql/logictests: don't fail parent test when using retry
Browse files Browse the repository at this point in the history
testutils.SucceedsSoon calls Fatal() on the passed testing.T.  Here,
we were calling SucceedsSoon with the root T, which in the case of a
subtest resulted in this error showing up in our logs

    testing.go:1169: test executed panic(nil) or runtime.Goexit:
    subtest may have called FailNow on a parent test

This moves to using SucceedsSoonError so that we can process errors
using the same formatting that we use elsewhere.

Release note: None
  • Loading branch information
stevendanna committed Jul 14, 2022
1 parent 8a910b5 commit 7069942
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3248,9 +3248,11 @@ func (t *logicTest) processSubtest(

for i := 0; i < repeat; i++ {
if query.retry && !*rewriteResultsInTestfiles {
testutils.SucceedsSoon(t.rootT, func() error {
if err := testutils.SucceedsSoonError(func() error {
return t.execQuery(query)
})
}); err != nil {
t.Error(err)
}
} else {
if query.retry && *rewriteResultsInTestfiles {
// The presence of the retry flag indicates that we expect this
Expand Down

0 comments on commit 7069942

Please sign in to comment.