summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommaso Tocci <tommaso.tocci@mongodb.com>2021-03-16 19:31:21 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-17 12:20:30 +0000
commitf9f0056b4f5e0c852a153f3c4153be67904f2d73 (patch)
treefd10d5995149f73744cf72076cb408e62415432c
parentdc68f885b80e70805eab8c5686ee0941bbdd806b (diff)
downloadmongo-f9f0056b4f5e0c852a153f3c4153be67904f2d73.tar.gz
SERVER-55231 Stop using standalone shards in noPassthrough tests
-rw-r--r--jstests/noPassthrough/shard_fixture_selftest.js27
-rw-r--r--jstests/noPassthrough/shell_mongobridge_port_allocation.js51
-rw-r--r--jstests/noPassthrough/unsupported_change_stream_deployments.js21
3 files changed, 24 insertions, 75 deletions
diff --git a/jstests/noPassthrough/shard_fixture_selftest.js b/jstests/noPassthrough/shard_fixture_selftest.js
index 25c4a374674..c81f6a1a0b7 100644
--- a/jstests/noPassthrough/shard_fixture_selftest.js
+++ b/jstests/noPassthrough/shard_fixture_selftest.js
@@ -9,12 +9,7 @@
load('jstests/concurrency/fsm_libs/shard_fixture.js');
-const rsTestOriginal = new ShardingTest({
- shards: 2,
- mongos: 2,
- config: 2,
- shardAsReplicaSet: true,
-});
+const rsTestOriginal = new ShardingTest({shards: 2, mongos: 2, config: 2});
const rsTestWrapper =
new FSMShardingTest(`mongodb://${rsTestOriginal.s0.host},${rsTestOriginal.s1.host}`);
@@ -38,22 +33,4 @@ assert.eq(rsTestWrapper.c(1).host, rsTestOriginal.c1.host);
assert.eq(rsTestWrapper.c(2), rsTestOriginal.c2); // Both should be undefined.
rsTestOriginal.stop();
-
-const dTestOriginal = new ShardingTest({
- shards: 1,
- mongos: 1,
- config: 1,
- shardAsReplicaSet: false,
-});
-
-const dTestWrapper = new FSMShardingTest(dTestOriginal.s.host);
-
-assert.eq(dTestWrapper.shard(0).host, dTestOriginal.shard0.host);
-assert.eq(dTestWrapper.s(0).host, dTestOriginal.s0.host);
-assert.eq(dTestWrapper.d(0).host, dTestOriginal.d0.host);
-assert.eq(dTestWrapper.c(0).host, dTestOriginal.c0.host);
-
-assert.eq(dTestWrapper.rs(0), dTestOriginal.rs0); // Both should be undefined.
-
-dTestOriginal.stop();
-})(); \ No newline at end of file
+})();
diff --git a/jstests/noPassthrough/shell_mongobridge_port_allocation.js b/jstests/noPassthrough/shell_mongobridge_port_allocation.js
index 2f73a55a0c7..df3da90dd45 100644
--- a/jstests/noPassthrough/shell_mongobridge_port_allocation.js
+++ b/jstests/noPassthrough/shell_mongobridge_port_allocation.js
@@ -44,39 +44,32 @@ for (let node of rst.nodes) {
rst.stopSet();
-// We run ShardingTest under mongobridge with both 1-node replica set shards and stand-alone
-// mongod shards.
-for (let options of [{rs: {nodes: 1}}, {rs: false, shardAsReplicaSet: false}]) {
- resetAllocatedPorts();
+// We run ShardingTest under mongobridge with 1-node replica set shards
+resetAllocatedPorts();
- const numMongos = 5;
- const numShards = 5;
- const st = new ShardingTest(Object.assign({
- mongos: numMongos,
- shards: numShards,
- config: {nodes: 1},
- useBridge: true,
- },
- options));
+const numMongos = 5;
+const numShards = 5;
+const st = new ShardingTest({
+ mongos: numMongos,
+ shards: numShards,
+ config: {nodes: 1},
+ rs: {nodes: 1},
+ useBridge: true,
+});
- for (let i = 0; i < numMongos; ++i) {
- checkBridgeOffset(st["s" + i], "mongos");
- }
+for (let i = 0; i < numMongos; ++i) {
+ checkBridgeOffset(st["s" + i], "mongos");
+}
- for (let configServer of st.configRS.nodes) {
- checkBridgeOffset(configServer, "config server");
- }
+for (let configServer of st.configRS.nodes) {
+ checkBridgeOffset(configServer, "config server");
+}
- for (let i = 0; i < numShards; ++i) {
- if (options.rs) {
- for (let node of st["rs" + i].nodes) {
- checkBridgeOffset(node, "shard");
- }
- } else {
- checkBridgeOffset(st["d" + i], "shard");
- }
+for (let i = 0; i < numShards; ++i) {
+ for (let node of st["rs" + i].nodes) {
+ checkBridgeOffset(node, "shard");
}
-
- st.stop();
}
+
+st.stop();
})();
diff --git a/jstests/noPassthrough/unsupported_change_stream_deployments.js b/jstests/noPassthrough/unsupported_change_stream_deployments.js
index f8eff504b14..2dcb2b46dcb 100644
--- a/jstests/noPassthrough/unsupported_change_stream_deployments.js
+++ b/jstests/noPassthrough/unsupported_change_stream_deployments.js
@@ -27,25 +27,4 @@ assert.neq(null, conn, "mongod was unable to start up");
assert.commandWorked(conn.getDB("test").ensure_db_exists.insert({}));
assertChangeStreamNotSupportedOnConnection(conn);
assert.eq(0, MongoRunner.stopMongod(conn));
-
-// Test a sharded cluster with standalone shards.
-const clusterWithStandalones = new ShardingTest({
- shards: 2,
- other: {shardOptions: {enableMajorityReadConcern: ""}},
- config: 1,
- shardAsReplicaSet: false
-});
-// Make sure the database exists before running any commands.
-const mongosDB = clusterWithStandalones.getDB("test");
-// enableSharding will create the db at the cluster level but not on the shards. $changeStream
-// through mongoS will be allowed to run on the shards despite the lack of a database.
-assert.commandWorked(mongosDB.adminCommand({enableSharding: "test"}));
-assertChangeStreamNotSupportedOnConnection(clusterWithStandalones.s);
-// Shard the 'ensure_db_exists' collection on a hashed key before running $changeStream on the
-// shards directly. This will ensure that the database is created on both shards.
-assert.commandWorked(
- mongosDB.adminCommand({shardCollection: "test.ensure_db_exists", key: {_id: "hashed"}}));
-assertChangeStreamNotSupportedOnConnection(clusterWithStandalones.shard0);
-assertChangeStreamNotSupportedOnConnection(clusterWithStandalones.shard1);
-clusterWithStandalones.stop();
}());