Skip to content

Commit 3d1b780

Browse files
author
Divjot Arora
authored
GODRIVER-1558 Sort on _id when verifying collections in tests (#375)
1 parent 0b473f6 commit 3d1b780

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

mongo/integration/unified_spec_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,13 +821,11 @@ func verifyTestOutcome(mt *mtest.T, outcomeColl *outcomeCollection) {
821821
if outcomeColl.Name != "" {
822822
collName = outcomeColl.Name
823823
}
824-
coll := mt.GlobalClient().Database(mt.DB.Name()).Collection(collName)
824+
coll := mt.GlobalClient().Database(mt.DB.Name()).Collection(collName, checkOutcomeOpts)
825825

826-
var err error
827-
coll, err = coll.Clone(checkOutcomeOpts)
828-
assert.Nil(mt, err, "Clone error: %v", err)
829-
830-
cursor, err := coll.Find(mtest.Background, bson.D{})
826+
findOpts := options.Find().
827+
SetSort(bson.M{"_id": 1})
828+
cursor, err := coll.Find(mtest.Background, bson.D{}, findOpts)
831829
assert.Nil(mt, err, "Find error: %v", err)
832830
verifyCursorResult(mt, cursor, outcomeColl.Data)
833831
}

0 commit comments

Comments
 (0)