summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-11-10 13:30:40 -0500
committerTess Avitabile <tess.avitabile@mongodb.com>2016-11-11 13:57:38 -0500
commit214c05c296661f39881e18dd57b92f19af1b2c01 (patch)
tree0ae1baed5b9dd68ef532ee788cd831592a46fe07 /jstests/noPassthroughWithMongod
parentbb7fb4a2434d83a6d2d2d2cd3eeb3588018e931f (diff)
downloadmongo-214c05c296661f39881e18dd57b92f19af1b2c01.tar.gz
SERVER-26911 Create RAII type for turning off replicated writes
Diffstat (limited to 'jstests/noPassthroughWithMongod')
-rw-r--r--jstests/noPassthroughWithMongod/eval_with_godinsert.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/eval_with_godinsert.js b/jstests/noPassthroughWithMongod/eval_with_godinsert.js
new file mode 100644
index 00000000000..7e39438f23b
--- /dev/null
+++ b/jstests/noPassthroughWithMongod/eval_with_godinsert.js
@@ -0,0 +1,15 @@
+// Test for SERVER-26911. Executing a godinsert and a findAndModify in the same eval should not
+// crash the server.
+(function() {
+ "use strict";
+
+ db.jstests_server26911.drop();
+
+ assert.writeOK(db.jstests_server26911.insert({_id: 0, a: 0}));
+
+ const godinsertCmd =
+ "assert.commandWorked(db.runCommand({godinsert: 'jstests_server26911', obj: {_id: 1}}));";
+ const findAndModifyCmd = "db.jstests_server26911.findOneAndReplace({a: 0}, {a: 1});";
+
+ assert.eq({_id: 0, a: 0}, db.eval(godinsertCmd + findAndModifyCmd));
+}()); \ No newline at end of file