summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Seyster <justin.seyster@mongodb.com>2021-08-20 16:49:35 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-24 23:06:19 +0000
commitd3580a142ca5b460226a561d293a22fc04940942 (patch)
treed393e2ddc4ae68201800f338cdd4d42260c78048
parent2f1d6f958ab17dc3fdc078883883674f111873f5 (diff)
downloadmongo-d3580a142ca5b460226a561d293a22fc04940942.tar.gz
SERVER-59458 Move interrupt_while_yielded.js to noPassthrough suite
-rw-r--r--jstests/noPassthrough/interrupt_while_yielded.js (renamed from jstests/noPassthroughWithMongod/interrupt_while_yielded.js)15
1 files changed, 13 insertions, 2 deletions
diff --git a/jstests/noPassthroughWithMongod/interrupt_while_yielded.js b/jstests/noPassthrough/interrupt_while_yielded.js
index 935e5224ea9..d344fbfd1a4 100644
--- a/jstests/noPassthroughWithMongod/interrupt_while_yielded.js
+++ b/jstests/noPassthrough/interrupt_while_yielded.js
@@ -4,7 +4,11 @@
const kFailPointName = "setYieldAllLocksHang";
const kCommandComment = "interruptedWhileYieldedComment";
+const conn = MongoRunner.runMongod();
+assert.neq(null, conn, "mongod was unable to start up");
+const db = conn.getDB("test");
const coll = db.interrupt_while_yielded;
+
coll.drop();
assert.commandWorked(coll.insert({a: 1, b: 1, c: 1}));
assert.commandWorked(coll.insert({a: 1, b: 1, c: 1}));
@@ -15,6 +19,11 @@ assert.commandWorked(coll.createIndex({a: 1, c: 1}));
// This is needed to make sure that a yield point is reached.
assert.commandWorked(db.adminCommand({setParameter: 1, internalQueryExecYieldIterations: 1}));
+/**
+ * Executes 'queryFn' in a parallel shell while a failpoint is enabled to hang operations during
+ * yield. Ensures that operation run by 'queryFn' reaches the yield point, then runs killOp()
+ * against the yielded operation.
+ */
function runTestWithQuery(queryFn) {
let waitForParallelShell = null;
@@ -35,7 +44,7 @@ function runTestWithQuery(queryFn) {
}
code += "(" + parallelShellFn.toString() + ")();";
- waitForParallelShell = startParallelShell(code);
+ waitForParallelShell = startParallelShell(code, conn.port);
// Find the operation running the query.
let opId = null;
@@ -76,7 +85,7 @@ function runTestWithQuery(queryFn) {
}
// Check that the server is still up.
- assert.commandWorked(db.adminCommand({isMaster: 1}));
+ assert.commandWorked(db.adminCommand({hello: 1}));
}
function rootedOr() {
@@ -108,4 +117,6 @@ function sortAndProjectionImmediatelyAfterMatch() {
.itcount();
}
runTestWithQuery(sortAndProjectionImmediatelyAfterMatch);
+
+MongoRunner.stopMongod(conn);
}());