Skip to content

Commit a03f404

Browse files
committed
CSHARP-2918: Fix race condition in test.
1 parent 9f972a3 commit a03f404

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/MongoDB.Driver.Tests/MongoCollectionImplTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,6 +3216,8 @@ public void Watch_should_support_full_document_with_duplicate_elements()
32163216
var client = DriverTestConfiguration.Client;
32173217
var database = client.GetDatabase(DriverTestConfiguration.DatabaseNamespace.DatabaseName);
32183218
var collection = database.GetCollection<BsonDocument>(DriverTestConfiguration.CollectionNamespace.CollectionName);
3219+
database.DropCollection(collection.CollectionNamespace.CollectionName); // ensure a clean collection state (e.g. no indexes)
3220+
collection.InsertOne(new BsonDocument("_id", 1)); // ensure database exists
32193221
database.DropCollection(collection.CollectionNamespace.CollectionName);
32203222

32213223
try

0 commit comments

Comments
 (0)