summaryrefslogtreecommitdiff
path: root/jstests/sharding/cursor1.js
diff options
context:
space:
mode:
authorJordi Serra Torrens <jordi.serra-torrens@mongodb.com>2021-01-21 11:08:07 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-22 10:25:46 +0000
commitf3617ccb88b713884ae8e3853eefa42e84feda6d (patch)
tree48f7d199e4355d5a33858a9cd57ae060c5e96a20 /jstests/sharding/cursor1.js
parentf2edde9de318c91ad7e711cea6dcc13726fce4b0 (diff)
downloadmongo-f3617ccb88b713884ae8e3853eefa42e84feda6d.tar.gz
SERVER-53105: Amend tests that target config.chunks by ns to target by ns or uuid depending on collection timestamp
Diffstat (limited to 'jstests/sharding/cursor1.js')
-rw-r--r--jstests/sharding/cursor1.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/sharding/cursor1.js b/jstests/sharding/cursor1.js
index 07497051b44..45af3d6f6dc 100644
--- a/jstests/sharding/cursor1.js
+++ b/jstests/sharding/cursor1.js
@@ -2,6 +2,8 @@
// checks that cursors survive a chunk's move
(function() {
+load("jstests/sharding/libs/find_chunks_util.js");
+
var s = new ShardingTest({name: "sharding_cursor1", shards: 2});
s.config.settings.find().forEach(printjson);
@@ -22,7 +24,7 @@ for (i = 0; i < numObjs; i++) {
}
assert.commandWorked(bulk.execute());
assert.eq(1,
- s.config.chunks.count({"ns": "test.foo"}),
+ findChunksUtil.countChunksForNs(s.config, "test.foo"),
"test requires collection to have one chunk initially");
// Cursor timeout only occurs outside of sessions. Otherwise we rely on the session timeout
@@ -42,7 +44,7 @@ assert.eq(7, cursor3.objsLeftInBatch());
s.adminCommand({split: "test.foo", middle: {_id: 5}});
s.adminCommand({movechunk: "test.foo", find: {_id: 5}, to: secondary.getMongo().name});
-assert.eq(2, s.config.chunks.count({"ns": "test.foo"}));
+assert.eq(2, findChunksUtil.countChunksForNs(s.config, "test.foo"));
// the cursors should not have been affected
assert.eq(numObjs, cursor1.itcount(), "c1");