Skip to content

Commit 68272c5

Browse files
committed
Fix race condition in test by using a request
1 parent cdfafe5 commit 68272c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/test/com/mongodb/BulkWriteOperationSpecification.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ class BulkWriteOperationSpecification extends FunctionalSpecification {
374374

375375
def 'unacknowledged upserts with custom _id should not error'() {
376376
given:
377+
collection.getDB().requestStart()
377378
def operation = initializeBulkOperation(ordered)
378379
operation.find(new BasicDBObject('_id', 0)).upsert()
379380
.updateOne(new BasicDBObject('$set', new BasicDBObject('a', 0)))
@@ -388,6 +389,9 @@ class BulkWriteOperationSpecification extends FunctionalSpecification {
388389
result == new UnacknowledgedBulkWriteResult()
389390
collection.count() == 4
390391

392+
cleanup:
393+
collection.getDB().requestDone()
394+
391395
where:
392396
ordered << [true, false]
393397
}

0 commit comments

Comments
 (0)