From bb67941a1ba9c04a58bc4cb74cfd02ec9f315024 Mon Sep 17 00:00:00 2001 From: Cheahuychou Mao Date: Wed, 25 Mar 2020 13:59:23 -0400 Subject: SERVER-47141 Make failpoint in NetworkInterfaceTL sort targets before constructing CommandState --- jstests/sharding/hedged_reads.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'jstests') diff --git a/jstests/sharding/hedged_reads.js b/jstests/sharding/hedged_reads.js index 9cf05016615..288f0d4d60a 100644 --- a/jstests/sharding/hedged_reads.js +++ b/jstests/sharding/hedged_reads.js @@ -94,15 +94,15 @@ st.rs0.nodes.forEach(function(conn) { assert.commandWorked( st.s.adminCommand({setParameter: 1, logComponentVerbosity: {network: {verbosity: 2}}})); -jsTest.log("Verify the initial request is canceled when the hedged request responds first"); +jsTest.log("Verify that the initial request is canceled when the hedged request responds first"); try { // Make the initial request block. - setCommandDelay(sortedNodes[0], "find", kLargeTimeoutMS); + setCommandDelay(sortedNodes[0], "count", kLargeTimeoutMS); const comment = "test_kill_initial_request_" + ObjectId(); assert.commandWorked(testDB.runCommand({ - find: collName, - filter: {x: {$gte: 0}}, + count: collName, + query: {x: {$gte: 0}}, $readPreference: {mode: "nearest"}, comment: comment })); @@ -117,18 +117,19 @@ try { clearCommandDelay(sortedNodes[0]); } -jsTest.log("Verify the additional request is canceled when the initial request responds first"); +jsTest.log( + "Verify that the additional request is canceled when the initial request responds first"); try { // Make the additional/hedged request block, set a large maxTimeMSForHedgedReads to prevent // the remote host from killing the operation by itself. assert.commandWorked( st.s.adminCommand({setParameter: 1, maxTimeMSForHedgedReads: kLargeTimeoutMS})); - setCommandDelay(sortedNodes[1], "find", kLargeTimeoutMS); + setCommandDelay(sortedNodes[1], "count", kLargeTimeoutMS); const comment = "test_kill_additional_request_" + ObjectId(); assert.commandWorked(testDB.runCommand({ - find: collName, - filter: {x: {$gte: 0}}, + count: collName, + query: {x: {$gte: 0}}, $readPreference: {mode: "nearest"}, comment: comment })); -- cgit v1.2.1