diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-12 09:54:35 -0500 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-14 16:03:53 -0500 |
commit | f99c8d913706efc48d3b41672eebbb6166e1680b (patch) | |
tree | ffc766e2fcaae87a5cd771acfea10451e1ac2007 /jstests/noPassthrough/out_max_time_ms.js | |
parent | ddb5d16aa7a5854d326bff0b6d094b33f1b662b5 (diff) | |
download | mongo-f99c8d913706efc48d3b41672eebbb6166e1680b.tar.gz |
SERVER-38191 Enforce restriction on namespace for failpoints in write_ops
This reverts commit d19bd0c883a338e4f443399c928700381c682e32.
Diffstat (limited to 'jstests/noPassthrough/out_max_time_ms.js')
-rw-r--r-- | jstests/noPassthrough/out_max_time_ms.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/jstests/noPassthrough/out_max_time_ms.js b/jstests/noPassthrough/out_max_time_ms.js index b4d2b6f41b2..dcad3c5c071 100644 --- a/jstests/noPassthrough/out_max_time_ms.js +++ b/jstests/noPassthrough/out_max_time_ms.js @@ -45,11 +45,20 @@ // use the 'maxTimeNeverTimeOut' failpoint to ensure that the operation does not // prematurely time out. const maxTimeMS = 1000 * 2; - const kFailPointName = - mode == "replaceDocuments" ? "hangDuringBatchUpdate" : "hangDuringBatchInsert"; + // Enable a failPoint so that the write will hang. - assert.commandWorked(connToHang.getDB("admin").runCommand( - {configureFailPoint: failPointName, mode: "alwaysOn"})); + let failpointCommand = { + configureFailPoint: failPointName, + mode: "alwaysOn", + data: {nss: kDBName + "." + kDestCollName} + }; + + // For mode "replaceCollection", the namespace of the writes will be to a temp namespace so + // remove the restriction on nss. + if (mode == "replaceCollection") + delete failpointCommand.data; + + assert.commandWorked(connToHang.getDB("admin").runCommand(failpointCommand)); // Make sure we don't run out of time before the failpoint is hit. assert.commandWorked(connToHang.getDB("admin").runCommand( |