diff options
Diffstat (limited to 'jstests/change_streams/whole_db_resumability.js')
-rw-r--r-- | jstests/change_streams/whole_db_resumability.js | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/jstests/change_streams/whole_db_resumability.js b/jstests/change_streams/whole_db_resumability.js index 25f03943112..f8f8d3fb64a 100644 --- a/jstests/change_streams/whole_db_resumability.js +++ b/jstests/change_streams/whole_db_resumability.js @@ -97,30 +97,22 @@ assert.writeOK(coll.insert({_id: 0})); // Test resuming from the 'dropDatabase' entry. - // TODO SERVER-34789: Resuming from the 'dropDatabase' should return a single invalidate - // notification. resumeCursor = cst.startWatchingChanges({ pipeline: [{$changeStream: {resumeAfter: dropDbChanges[1]._id}}], collection: 1, aggregateOptions: {cursor: {batchSize: 0}}, }); - let change = cst.getOneChange(resumeCursor); - assert.eq(change.operationType, "insert", tojson(change)); - assert.eq(change.fullDocument, {_id: 0}, tojson(change)); - assert.eq(change.ns, {db: testDB.getName(), coll: coll.getName()}, tojson(change)); + cst.assertNextChangesEqual( + {cursor: resumeCursor, expectedChanges: [{operationType: "invalidate"}]}); // Test resuming from the 'invalidate' entry. - // TODO SERVER-34789: Resuming from an invalidate should error or return an invalidate - // notification. resumeCursor = cst.startWatchingChanges({ pipeline: [{$changeStream: {resumeAfter: dropDbChanges[2]._id}}], collection: 1, aggregateOptions: {cursor: {batchSize: 0}}, }); - change = cst.getOneChange(resumeCursor); - assert.eq(change.operationType, "insert", tojson(change)); - assert.eq(change.fullDocument, {_id: 0}, tojson(change)); - assert.eq(change.ns, {db: testDB.getName(), coll: coll.getName()}, tojson(change)); + cst.assertNextChangesEqual( + {cursor: resumeCursor, expectedChanges: [{operationType: "invalidate"}]}); cst.cleanUp(); })(); |