Skip to content

Commit 4ba3d42

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 bba2441 commit 4ba3d42

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
@@ -173,8 +173,12 @@ func TestDiagnosticsRequest(t *testing.T) {
173173
require.True(t, strings.Contains(err.Error(), sqlerrors.QueryTimeoutError.Error()))
174174

175175
// Reset the stmt timeout so that it doesn't affect the query in
176-
// checkCompleted.
177-
runner.Exec(t, "RESET statement_timeout;")
176+
// checkCompleted. Wrap it in a SucceedsSoon in case RESET query itself
177+
// times out.
178+
testutils.SucceedsSoon(t, func() error {
179+
_, err = db.Exec("RESET statement_timeout;")
180+
return err
181+
})
178182
checkCompleted(reqID)
179183
})
180184

0 commit comments

Comments
 (0)