summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/sharding/index_commands_shard_targeting.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/sharding/index_commands_shard_targeting.js b/jstests/sharding/index_commands_shard_targeting.js
index 4d2e60019d2..47f79e8c873 100644
--- a/jstests/sharding/index_commands_shard_targeting.js
+++ b/jstests/sharding/index_commands_shard_targeting.js
@@ -89,14 +89,16 @@ function assertCommandBlocksIfCriticalSectionInProgress(
waitForMoveChunkStep(fromShard, moveChunkStepNames.chunkDataCommitted);
// Run the command with maxTimeMS.
- const cmdWithMaxTimeMS = Object.assign({}, testCase.command, {maxTimeMS: 500});
+ const cmdWithMaxTimeMS = Object.assign({}, testCase.command, {maxTimeMS: 750});
let cmdThread = new Thread((host, dbName, cmdWithMaxTimeMS) => {
const conn = new Mongo(host);
conn.getDB(dbName).runCommand(cmdWithMaxTimeMS);
}, st.s.host, dbName, cmdWithMaxTimeMS);
cmdThread.start();
- // Assert that the command eventually times out.
+ // Assert that the command reached the shard and then timed out.
+ // It could be possible that the following check fails on slow clusters because the request
+ // expired its maxTimeMS on the mongos before to reach the shard.
checkLog.contains(st.shard0,
new RegExp("Failed to refresh metadata for collection.*MaxTimeMSExpired"));
cmdThread.join();