Skip to content

Commit b1b5d2c

Browse files
committed
CSHARP-2918: Fix race condition in test.
1 parent c80fb8c commit b1b5d2c

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
@@ -3429,6 +3429,8 @@ public void Watch_should_support_full_document_with_duplicate_elements()
34293429
var client = DriverTestConfiguration.Client;
34303430
var database = client.GetDatabase(DriverTestConfiguration.DatabaseNamespace.DatabaseName);
34313431
var collection = database.GetCollection<BsonDocument>(DriverTestConfiguration.CollectionNamespace.CollectionName);
3432+
database.DropCollection(collection.CollectionNamespace.CollectionName); // ensure a clean collection state (e.g. no indexes)
3433+
collection.InsertOne(new BsonDocument("_id", 1)); // ensure database exists
34323434
database.DropCollection(collection.CollectionNamespace.CollectionName);
34333435

34343436
try

0 commit comments

Comments
 (0)