diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-11 18:22:37 -0500 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-11 18:27:35 -0500 |
commit | 587ad0e175cb501e378f4aeaf37199dbb28dd011 (patch) | |
tree | f3ffab15d358d9ef9559e570ce26e9da14ea376f /jstests/noPassthrough/out_max_time_ms.js | |
parent | 1006d88b7522a11ed34ba1a751678ea7f7637754 (diff) | |
download | mongo-587ad0e175cb501e378f4aeaf37199dbb28dd011.tar.gz |
SERVER-38191 Enforce restriction on namespace for failpoints in write_ops
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( |