Skip to content

Commit 8d7d148

Browse files
committed
stmtdiagnostics: fix bizarre flake in TestDiagnosticsRequest
We just saw a failure in `TestDiagnosticsRequest` where "RESET statement_timeout;" itself timed out. Prevent such a flake by wrapping with SucceedsSoon. Release note: None
1 parent 6af1c9c commit 8d7d148

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/sql/stmtdiagnostics/statement_diagnostics_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,12 @@ func TestDiagnosticsRequest(t *testing.T) {
166166
require.True(t, strings.Contains(err.Error(), sqlerrors.QueryTimeoutError.Error()))
167167

168168
// Reset the stmt timeout so that it doesn't affect the query in
169-
// checkCompleted.
170-
runner.Exec(t, "RESET statement_timeout;")
169+
// checkCompleted. Wrap it in a SucceedsSoon in case RESET query itself
170+
// times out.
171+
testutils.SucceedsSoon(t, func() error {
172+
_, err = db.Exec("RESET statement_timeout;")
173+
return err
174+
})
171175
checkCompleted(reqID)
172176
})
173177

0 commit comments

Comments
 (0)