diff options
author | Arun Banala <arun.banala@mongodb.com> | 2022-04-29 12:56:44 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-23 07:52:57 +0000 |
commit | 9d559b3ad8942ade301b41284dee9e6b8c8f098c (patch) | |
tree | 2942842824443d062be972c637219e02136ac93c /jstests/sharding/resharding_change_stream_internal_ops.js | |
parent | fb4724113317c2279e340047b3a1cd8d6c72fb36 (diff) | |
download | mongo-9d559b3ad8942ade301b41284dee9e6b8c8f098c.tar.gz |
SERVER-65909 Make oplog and change stream formats of {op: "n"} events consistent
Diffstat (limited to 'jstests/sharding/resharding_change_stream_internal_ops.js')
-rw-r--r-- | jstests/sharding/resharding_change_stream_internal_ops.js | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/jstests/sharding/resharding_change_stream_internal_ops.js b/jstests/sharding/resharding_change_stream_internal_ops.js index ffab2469c04..46d14a5e890 100644 --- a/jstests/sharding/resharding_change_stream_internal_ops.js +++ b/jstests/sharding/resharding_change_stream_internal_ops.js @@ -92,10 +92,21 @@ reshardingTest.withReshardingInBackground( operationType: "reshardBegin" }; - cstDonor0.assertNextChangesEqual( - {cursor: changeStreamsCursorDonor0, expectedChanges: [expectedReshardBeginEvent]}); - cstDonor1.assertNextChangesEqual( - {cursor: changeStreamsCursorDonor1, expectedChanges: [expectedReshardBeginEvent]}); + const reshardBeginDonor0Event = + cstDonor0.getNextChanges(changeStreamsCursorDonor0, 1, false /* skipFirstBatch */); + + // The 'ns' field was added after 6.0, so the field will be absent when running on a 6.0 + // mongod. Delete the field so that the test can run on a mixed version suite. + // + // TODO SERVER-66645: Remove this line after branching for 7.0. + delete reshardBeginDonor0Event[0].ns; + + assertChangeStreamEventEq(reshardBeginDonor0Event[0], expectedReshardBeginEvent); + + const reshardBeginDonor1Event = + cstDonor1.getNextChanges(changeStreamsCursorDonor1, 1, false /* skipFirstBatch */); + delete reshardBeginDonor1Event[0].ns; + assertChangeStreamEventEq(reshardBeginDonor1Event[0], expectedReshardBeginEvent); }, { postDecisionPersistedFn: () => { @@ -105,10 +116,16 @@ reshardingTest.withReshardingInBackground( operationType: "reshardDoneCatchUp" }; - cstRecipient0.assertNextChangesEqual({ - cursor: changeStreamsCursorRecipient0, - expectedChanges: [expectedReshardDoneCatchUpEvent] - }); + const reshardDoneCatchUpEvent = cstRecipient0.getNextChanges( + changeStreamsCursorRecipient0, 1, false /* skipFirstBatch */); + + // The 'ns' field was added after 6.0, so the field will be absent when running on a 6.0 + // mongod. Delete the field so that the test can run on a mixed version suite. + // + // TODO SERVER-66645: Remove this line after branching for 7.0. + delete reshardDoneCatchUpEvent[0].ns; + + assertChangeStreamEventEq(reshardDoneCatchUpEvent[0], expectedReshardDoneCatchUpEvent); } }); |