Skip to content

Commit 7a1e2bc

Browse files
committed
backup: fix flaky OR recovery test
OR recovery test was flaking due to an insufficient timeout and also ran into errors due to the default database being set offline. This patch fixes the test to account for these errors. Epic: CRDB-51394 Fixes: #148424 Release note: None
1 parent d0365c2 commit 7a1e2bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/cmd/roachtest/tests/backup_restore_roundtrip.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,12 @@ func testOnlineRestoreRecovery(ctx context.Context, t test.Test, c cluster.Clust
539539
)
540540
}
541541

542+
// defaultdb is going to be set offline by the failed download job, so we
543+
// need to switch to the system database first to avoid any errors.
544+
if _, err := dbConn.ExecContext(ctx, "USE system"); err != nil {
545+
return err
546+
}
547+
542548
if _, err := dbConn.ExecContext(
543549
ctx, "SET CLUSTER SETTING jobs.debug.pausepoints = ''",
544550
); err != nil {
@@ -558,7 +564,7 @@ func testOnlineRestoreRecovery(ctx context.Context, t test.Test, c cluster.Clust
558564
err, "waiting for download job %v to reach resumed state", downloadJobID,
559565
)
560566
}
561-
if err := WaitForFailed(ctx, dbConn, jobspb.JobID(downloadJobID), jobStatusWait); err != nil {
567+
if err := WaitForFailed(ctx, dbConn, jobspb.JobID(downloadJobID), 10*time.Minute); err != nil {
562568
return errors.Wrapf(
563569
err, "waiting for download job %v to reach failed state", downloadJobID,
564570
)

0 commit comments

Comments
 (0)