summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2021-03-04 09:37:16 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-04 10:40:00 +0000
commite1c0d567de37310c32f7154d46e00f10f020610f (patch)
tree8dac3fc2d64af054c066e98b3f1bb898ec403466
parent5090027fadbd3c552b281ec84ca45cdfc89f6828 (diff)
downloadmongo-e1c0d567de37310c32f7154d46e00f10f020610f.tar.gz
SERVER-54949 Remove the `enableSharding` then `shardCollection` from another MongoS test case
-rw-r--r--jstests/sharding/enable_sharding.js17
1 files changed, 2 insertions, 15 deletions
diff --git a/jstests/sharding/enable_sharding.js b/jstests/sharding/enable_sharding.js
index 0fe510083c6..5233e1087be 100644
--- a/jstests/sharding/enable_sharding.js
+++ b/jstests/sharding/enable_sharding.js
@@ -5,7 +5,7 @@
(function() {
'use strict';
-var st = new ShardingTest({mongos: 2, shards: 2});
+var st = new ShardingTest({shards: 2});
jsTest.log('enableSharding can run only against the admin database');
{
@@ -49,20 +49,7 @@ jsTest.log('Verify config.databases metadata');
}
jsTest.log('Sharding a collection before enableSharding is called fails');
-{
- assert.commandFailed(st.s0.adminCommand({shardCollection: 'TestDB.TestColl', key: {_id: 1}}));
- assert.commandFailed(st.s1.adminCommand({shardCollection: 'TestDB.TestColl', key: {_id: 1}}));
-
- assert.commandWorked(st.s0.getDB('TestDB').TestColl.insert({_id: 0}));
- assert.commandWorked(st.s1.getDB('TestDB').TestColl.insert({_id: 1}));
-}
-
-jsTest.log('Calling enableSharding on one mongos and shardCollection through another must work');
-{
- assert.commandWorked(st.s0.adminCommand({enableSharding: 'TestDB'}));
- assert.commandWorked(st.s1.adminCommand({shardCollection: 'TestDB.TestColl', key: {_id: 1}}));
- assert.commandWorked(st.s0.adminCommand({shardCollection: 'TestDB.TestColl', key: {_id: 1}}));
-}
+{ assert.commandFailed(st.s0.adminCommand({shardCollection: 'TestDB.TestColl', key: {_id: 1}})); }
jsTest.log('Cannot enable sharding on a database using a wrong shard name');
{