summaryrefslogtreecommitdiff
path: root/jstests/change_streams/change_stream_rename_resumability.js
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2018-04-10 10:04:41 -0400
committerNick Zolnierz <nicholas.zolnierz@mongodb.com>2018-05-29 09:51:51 -0400
commita76082905d63ac8aaaae25e5c76812e6edf9bc07 (patch)
tree5882b480ff3b7378a30f27106cd8fad6e8271407 /jstests/change_streams/change_stream_rename_resumability.js
parent8150b50f14579b6cbd673f12968726670f6e1b78 (diff)
downloadmongo-a76082905d63ac8aaaae25e5c76812e6edf9bc07.tar.gz
SERVER-32088: ChangeStream resumeAfter does not work on sharded collections if not all shards have chunks for the collection
Diffstat (limited to 'jstests/change_streams/change_stream_rename_resumability.js')
-rw-r--r--jstests/change_streams/change_stream_rename_resumability.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/jstests/change_streams/change_stream_rename_resumability.js b/jstests/change_streams/change_stream_rename_resumability.js
index 5d7e8d3c153..46a3b3575b0 100644
--- a/jstests/change_streams/change_stream_rename_resumability.js
+++ b/jstests/change_streams/change_stream_rename_resumability.js
@@ -5,7 +5,7 @@
load("jstests/libs/collection_drop_recreate.js"); // For assert[Drop|Create]Collection.
- const coll = assertDropAndRecreateCollection(db, "change_stream_invalidate_resumability");
+ let coll = assertDropAndRecreateCollection(db, "change_stream_invalidate_resumability");
// Drop the collection we'll rename to _before_ starting the changeStream, so that we don't
// get accidentally an invalidate when running on the whole DB or cluster.
@@ -19,8 +19,11 @@
assert.commandWorked(coll.renameCollection(coll.getName() + "_renamed"));
+ // Update 'coll' to point to the renamed collection.
+ coll = db[coll.getName() + "_renamed"];
+
// Insert another document after the rename.
- assert.commandWorked(coll.insert({_id: 2}));
+ assert.writeOK(coll.insert({_id: 2}));
// We should get 2 oplog entries of type insert and invalidate.
assert.soon(() => cursor.hasNext());