Skip to content

Commit

Permalink
Force unique clusterTime values by splitting insert into two commands (
Browse files Browse the repository at this point in the history
  • Loading branch information
jyemin committed Apr 2, 2024
1 parent d72a379 commit 5ecde1e
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -519,7 +519,13 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio
def cursor = execute(operation, async)

when:
def expected = insertDocuments(helper, [1, 2])
// split into two insert commands, because starting in MongoDB 8.0 the same clusterTime is applied to all documents in a bulk
// write operation, and the test relies on the clusterTime values being both ascending _and_ unique.
def expectedOne = insertDocuments(helper, [1])
def expectedTwo = insertDocuments(helper, [2])
def expected = []
expected.addAll(expectedOne)
expected.addAll(expectedTwo)
def result = next(cursor, async, 2)

then:
Expand Down

0 comments on commit 5ecde1e

Please sign in to comment.