Skip to content

Commit

Permalink
backup: add wait to flaky test
Browse files Browse the repository at this point in the history
This test has been flaky because the TableDescriptor being read is being
seen as OFFLINE. This issue seems to disappear after waiting a bit. This
also happens during IMPORT and this issue was avoided in a similar way
(see cockroachdb#36832).

This should be removed and cockroachdb#40951 is tracking this issue.

Release justification: Work-around for a flaky test.

Release note: None
  • Loading branch information
pbardea committed Sep 20, 2019
1 parent 1adb5d7 commit 891b407
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/ccl/backupccl/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,19 @@ func TestBackupRestoreWithConcurrentWrites(t *testing.T) {
sqlDB.Exec(t, `RESTORE data.* FROM $1`, localFoo)
atomic.StoreInt32(&allowErrors, 0)

// TODO(pbardea): Without this wait we see this test falke under stress.
// See #40951 for the tracking issue.
for i := 0; i < 5; i++ {
_, err := tc.Conns[1].Exec("SELECT * FROM bank.bank LIMIT 1")
if err != nil {
t.Logf("%s", err)
time.Sleep(time.Second)
continue
}
t.Logf("found the table")
break
}

bad := sqlDB.QueryStr(t, `SELECT id, balance, payload FROM data.bank WHERE id != balance`)
for _, r := range bad {
t.Errorf("bad row ID %s = bal %s (payload: %q)", r[0], r[1], r[2])
Expand Down

0 comments on commit 891b407

Please sign in to comment.