Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
40795: backupccl: fix test to actually use SucceedsSoon r=ajwerner a=ajwerner

I saw this test fail because `sqldb.Exec` will call `t.Error()` if the
`ALTER TABLE` fails. The `SucceedsSoon` was there for a good reason but was
not doing anything.

Release Justification: Fix for a flakey test.

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
  • Loading branch information
craig[bot] and ajwerner committed Sep 18, 2019
2 parents 09acaf4 + 4297acf commit 74a20a7
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions pkg/ccl/backupccl/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,16 @@ func TestBackupRestorePartitioned(t *testing.T) {
// made in backupRestoreTestSetup.) These are wrapped with SucceedsSoon()
// because EXPERIMENTAL_RELOCATE can fail if there are other replication
// changes happening.
testutils.SucceedsSoon(t, func() error {
sqlDB.Exec(t, `ALTER TABLE data.bank EXPERIMENTAL_RELOCATE VALUES (ARRAY[1], 0)`)
return nil
})
testutils.SucceedsSoon(t, func() error {
sqlDB.Exec(t, `ALTER TABLE data.bank EXPERIMENTAL_RELOCATE VALUES (ARRAY[2], 100)`)
return nil
})
testutils.SucceedsSoon(t, func() error {
sqlDB.Exec(t, `ALTER TABLE data.bank EXPERIMENTAL_RELOCATE VALUES (ARRAY[3], 200)`)
return nil
})

for _, stmt := range []string{
`ALTER TABLE data.bank EXPERIMENTAL_RELOCATE VALUES (ARRAY[1], 0)`,
`ALTER TABLE data.bank EXPERIMENTAL_RELOCATE VALUES (ARRAY[2], 100)`,
`ALTER TABLE data.bank EXPERIMENTAL_RELOCATE VALUES (ARRAY[3], 200)`,
} {
testutils.SucceedsSoon(t, func() error {
_, err := sqlDB.DB.ExecContext(ctx, stmt)
return err
})
}
const localFoo1 = localFoo + "/1"
const localFoo2 = localFoo + "/2"
const localFoo3 = localFoo + "/3"
Expand Down

0 comments on commit 74a20a7

Please sign in to comment.