diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2020-05-20 17:01:49 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-10 16:26:43 +0000 |
commit | ff8a74db8a39fbc89bb25fee964dc2d1173acacd (patch) | |
tree | e26dd1748abab14b0d6611e3cc73315c97ea255e | |
parent | b937b31a60d6f62c68329bb05fc0b5bfacd17217 (diff) | |
download | mongo-ff8a74db8a39fbc89bb25fee964dc2d1173acacd.tar.gz |
SERVER-48339 Ensure operation is hung on failpoint in unionWith_current_op.js
-rw-r--r-- | buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml | 4 | ||||
-rw-r--r-- | jstests/sharding/query/unionWith_current_op.js | 21 |
2 files changed, 13 insertions, 12 deletions
diff --git a/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml b/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml index 41892fead96..e5ab6977777 100644 --- a/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml +++ b/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml @@ -30,7 +30,6 @@ selector: - jstests/sharding/test_stacked_migration_cleanup.js - jstests/sharding/kill_pinned_cursor.js - jstests/sharding/killop.js - - jstests/sharding/verify_sessions_expiration_sharded.js # Enable when 4.6 becomes last stable - jstests/sharding/mongos_dataSize.js # Enable when SERVER-44733 is backported @@ -41,6 +40,9 @@ selector: - jstests/sharding/cluster_create_indexes_always_routes_through_primary.js # TODO SERVER-46040: Enable when SERVER-46040 is backported - jstests/sharding/drop_indexes_with_stale_config_error.js + # Enable when SERVER-43614 is backported. + - jstests/sharding/query/unionWith_current_op.js + - jstests/sharding/verify_sessions_expiration_sharded.js executor: config: diff --git a/jstests/sharding/query/unionWith_current_op.js b/jstests/sharding/query/unionWith_current_op.js index 37d18a40eb2..f05150d366d 100644 --- a/jstests/sharding/query/unionWith_current_op.js +++ b/jstests/sharding/query/unionWith_current_op.js @@ -6,6 +6,7 @@ "use strict"; load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers. +load("jstests/libs/curop_helpers.js"); // For waitForCurOpByFailPoint. const st = new ShardingTest({shards: 2}); const testDB = st.s.getDB(jsTestName()); @@ -31,10 +32,11 @@ setupShardColl(shardedColl1); setupShardColl(shardedColl2); assert.commandWorked(unshardedColl.insert({x: 1, _id: 1})); +const kFailPointName = "waitAfterCommandFinishesExecution"; function setPostCommandFailpointOnShards({mode, options}) { FixtureHelpers.runCommandOnEachPrimary({ db: testDB.getSiblingDB("admin"), - cmdObj: {configureFailPoint: "waitAfterCommandFinishesExecution", data: options, mode: mode} + cmdObj: {configureFailPoint: kFailPointName, data: options, mode: mode} }); } @@ -58,18 +60,15 @@ function runTest({command, expectedRunningOps, collToPause}) { // Run the 'command' in a parallel shell. let unionShell = startParallelShell(parallelFunction, st.s.port); + const filter = {"command.aggregate": collToPause.getName(), "command.comment": commentObj}; + const deepestUnion = expectedRunningOps[expectedRunningOps.length - 1]; // Wait for the parallel shell to hit the failpoint and verify that the 'comment' field is // present in $currentOp. - const filter = {'command.aggregate': collToPause.getName(), "command.comment": commentObj}; - - const deepestUnion = expectedRunningOps[expectedRunningOps.length - 1]; - assert.soon(() => testDB.getSiblingDB("admin") - .aggregate([{$currentOp: {localOps: false}}, {$match: filter}]) - .toArray() - .length == deepestUnion.count, - () => tojson(testDB.getSiblingDB("admin") - .aggregate([{$currentOp: {localOps: false}}, {$match: filter}]) - .toArray())); + assert.soon(() => { + const results = + waitForCurOpByFailPoint(testDB, collToPause.getFullName(), kFailPointName, filter); + return results.length == deepestUnion.count; + }); // Verify that MongoS has an operation running for the base aggregation. filter['command.aggregate'] = expectedRunningOps[0].coll.getName(); |