diff options
Diffstat (limited to 'jstests/sharding/resharding_disallow_writes.js')
-rw-r--r-- | jstests/sharding/resharding_disallow_writes.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/sharding/resharding_disallow_writes.js b/jstests/sharding/resharding_disallow_writes.js index 22f502a949c..a403a58a99a 100644 --- a/jstests/sharding/resharding_disallow_writes.js +++ b/jstests/sharding/resharding_disallow_writes.js @@ -72,8 +72,10 @@ reshardingTest.withReshardingInBackground( jsTestLog("Attempting collMod"); assert.commandFailedWithCode( - sourceCollection.runCommand({collMod: sourceCollection.getName()}), - ErrorCodes.ReshardCollectionInProgress); + // The collMod is serialized with the resharding command, so we explicitly add an + // timeout to the command so that it doesn't get blocked and timeout the test. + sourceCollection.runCommand({collMod: sourceCollection.getName(), maxTimeMS: 5000}), + [ErrorCodes.ReshardCollectionInProgress, ErrorCodes.MaxTimeMSExpired]); jsTestLog("Attempting drop index"); assert.commandFailedWithCode( |