Skip to content

Commit 48f5aa7

Browse files
author
Divjot Arora
committed
Fix test cases for ListCollections
Change-Id: I616d9fabbaa44376c077256d9de276eec2b65172
1 parent 1a4b9ed commit 48f5aa7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

mongo/database_internal_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,19 @@ func listCollectionsTest(db *Database, cappedOnly bool) error {
249249
)
250250
}
251251

252-
cursor, err := db.ListCollections(context.Background(), filter)
253-
if err != nil {
254-
return err
252+
for i := 0; i < 10; i++ {
253+
cursor, err := db.ListCollections(context.Background(), filter)
254+
if err != nil {
255+
return err
256+
}
257+
258+
err = verifyListCollections(cursor, uncappedName, cappedName, cappedOnly)
259+
if err == nil {
260+
return nil
261+
}
255262
}
256263

257-
return verifyListCollections(cursor, uncappedName, cappedName, cappedOnly)
264+
return err // all tests failed
258265
}
259266

260267
func TestDatabase_ListCollections(t *testing.T) {

0 commit comments

Comments
 (0)