Skip to content

Commit 7593dfe

Browse files
authored
CBG-4689 ensure all indexes are deleted (#7602)
1 parent 222a29a commit 7593dfe

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

base/util_testing.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,19 @@ func DropAllIndexes(ctx context.Context, n1QLStore N1QLStore) error {
354354
return asyncError
355355
default:
356356
}
357-
358-
return nil
357+
// DROP INDEX is asynchronous, but generally quick. Wait for all indexes to disappear as part of the test harness.
358+
err, _ = RetryLoop(ctx, "Waiting for no indexes on the bucket", func() (shouldRetry bool, err error, _ any) {
359+
// Retrieve all indexes on the bucket/collection
360+
indexes, err := n1QLStore.GetIndexes()
361+
if err != nil {
362+
return false, err, nil
363+
}
364+
if len(indexes) == 0 {
365+
return false, nil, nil
366+
}
367+
return true, nil, nil
368+
}, CreateSleeperFunc(500, 100))
369+
return err
359370
}
360371

361372
// Generates a string of size int

0 commit comments

Comments
 (0)