diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2020-03-18 15:17:56 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-25 17:40:43 +0000 |
commit | fe79c4ee1dfc8d49ae06c94a927267712b32b011 (patch) | |
tree | a5ddce887802b62fb028c5d707186ebb64effe66 /jstests/aggregation/mongos_slaveok.js | |
parent | b36c69c5930d25a8f5ae348a2b2fb24f27f925e6 (diff) | |
download | mongo-fe79c4ee1dfc8d49ae06c94a927267712b32b011.tar.gz |
SERVER-46700 Update tests in aggregation suite to avoid spawning mongod/sharded clusters
Diffstat (limited to 'jstests/aggregation/mongos_slaveok.js')
-rw-r--r-- | jstests/aggregation/mongos_slaveok.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/jstests/aggregation/mongos_slaveok.js b/jstests/aggregation/mongos_slaveok.js deleted file mode 100644 index f1c235266fc..00000000000 --- a/jstests/aggregation/mongos_slaveok.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Tests aggregate command against mongos with slaveOk. For more tests on read preference, - * please refer to jstests/sharding/read_pref_cmd.js. - * @tags: [ - * requires_replication, - * requires_sharding, - * requires_spawning_own_processes, - * requires_profiling - * ] - */ -(function() { -load('jstests/replsets/rslib.js'); - -var NODES = 2; - -var doTest = function(st, doSharded) { - var testDB = st.s.getDB('test'); - - if (doSharded) { - testDB.adminCommand({enableSharding: 'test'}); - testDB.adminCommand({shardCollection: 'test.user', key: {x: 1}}); - } - - testDB.user.insert({x: 10}, {writeConcern: {w: NODES}}); - testDB.setSlaveOk(true); - - var secNode = st.rs0.getSecondary(); - secNode.getDB('test').setProfilingLevel(2); - - // wait for mongos to recognize that the slave is up - awaitRSClientHosts(st.s, secNode, {ok: true}); - - var res = testDB.runCommand({aggregate: 'user', pipeline: [{$project: {x: 1}}], cursor: {}}); - assert(res.ok, 'aggregate command failed: ' + tojson(res)); - - var profileQuery = {op: 'command', ns: 'test.user', 'command.aggregate': 'user'}; - var profileDoc = secNode.getDB('test').system.profile.findOne(profileQuery); - - assert(profileDoc != null); - testDB.dropDatabase(); -}; - -var st = new ShardingTest({shards: {rs0: {oplogSize: 10, nodes: NODES}}}); - -doTest(st, false); -doTest(st, true); - -st.stop(); -})(); |