summaryrefslogtreecommitdiff
path: root/jstests/sharding/create_idx_empty_primary.js
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2018-02-07 17:38:49 -0500
committerjannaerin <golden.janna@gmail.com>2018-03-09 00:40:40 -0500
commitda1e0304e8eb91711ea1c78eb8f62538b53680e7 (patch)
treee55d32a40a76a39e01d8848c5a17d97ad640b18e /jstests/sharding/create_idx_empty_primary.js
parent0d5370783beeb4936a181dd2f69387da4b5e816c (diff)
downloadmongo-da1e0304e8eb91711ea1c78eb8f62538b53680e7.tar.gz
SERVER-32052 Update ShardingTest to default to starting shard servers as replica sets
Diffstat (limited to 'jstests/sharding/create_idx_empty_primary.js')
-rw-r--r--jstests/sharding/create_idx_empty_primary.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/jstests/sharding/create_idx_empty_primary.js b/jstests/sharding/create_idx_empty_primary.js
index f8beffa7e52..1610c1fef44 100644
--- a/jstests/sharding/create_idx_empty_primary.js
+++ b/jstests/sharding/create_idx_empty_primary.js
@@ -6,14 +6,14 @@
var st = new ShardingTest({shards: 2});
assert.commandWorked(st.s.adminCommand({enablesharding: 'test'}));
- st.ensurePrimaryShard('test', 'shard0001');
+ st.ensurePrimaryShard('test', st.shard1.shardName);
var testDB = st.s.getDB('test');
assert.commandWorked(testDB.adminCommand({shardcollection: 'test.user', key: {_id: 1}}));
// Move only chunk out of primary shard.
assert.commandWorked(
- testDB.adminCommand({movechunk: 'test.user', find: {_id: 0}, to: 'shard0000'}));
+ testDB.adminCommand({movechunk: 'test.user', find: {_id: 0}, to: st.shard0.shardName}));
assert.writeOK(testDB.user.insert({_id: 0}));
@@ -23,10 +23,10 @@
var indexes = testDB.user.getIndexes();
assert.eq(2, indexes.length);
- indexes = st.d0.getDB('test').user.getIndexes();
+ indexes = st.rs0.getPrimary().getDB('test').user.getIndexes();
assert.eq(2, indexes.length);
- indexes = st.d1.getDB('test').user.getIndexes();
+ indexes = st.rs1.getPrimary().getDB('test').user.getIndexes();
assert.eq(2, indexes.length);
st.stop();