summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Liu <rui.liu@mongodb.com>2021-11-05 12:16:26 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-11 15:28:26 +0000
commitad6c9823b2903f68898f08d4160ab2f72cf8a82a (patch)
tree66630f7025ed13998aa4052fc6c5a28eee80b915
parent48f4a7142146efbf2e2d803118d409f9075f0629 (diff)
downloadmongo-ad6c9823b2903f68898f08d4160ab2f72cf8a82a.tar.gz
SERVER-61269 Adding log to awaitdata_getmore_cmd.js
(cherry picked from commit a759937cd24db35ab18206569eae72b284e6857b)
-rw-r--r--jstests/core/awaitdata_getmore_cmd.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/jstests/core/awaitdata_getmore_cmd.js b/jstests/core/awaitdata_getmore_cmd.js
index fae96fbdc91..9d9cd1460db 100644
--- a/jstests/core/awaitdata_getmore_cmd.js
+++ b/jstests/core/awaitdata_getmore_cmd.js
@@ -165,6 +165,7 @@ let insertshell = startParallelShell(() => {
assert.commandWorked(db.await_data.insert({_id: "signal parent shell"}));
// Wait for the parent shell to start watching for the next document.
+ jsTestLog("Checking getMore is being blocked...");
assert.soon(() => db.currentOp({
op: "getmore",
"cursor.originatingCommand.comment": "uniquifier_comment"
@@ -176,6 +177,7 @@ let insertshell = startParallelShell(() => {
// Make sure the getMore has not ended after a while.
sleep(2000);
+ jsTestLog("Checking getMore is still being blocked...");
assert.eq(
db.currentOp({op: "getmore", "cursor.originatingCommand.comment": "uniquifier_comment"})
.inprog.length,
@@ -183,7 +185,9 @@ let insertshell = startParallelShell(() => {
tojson(db.currentOp().inprog));
// Now write a matching document to wake it up.
+ jsTestLog("Sending signal to getMore...");
assert.commandWorked(db.await_data.insert({_id: "match", x: 1}));
+ jsTestLog("Insertion shell finished successfully.");
});
// Wait until we receive confirmation that the parallel shell has started.
@@ -192,13 +196,16 @@ assert.soon(() => db.await_data.findOne({_id: "signal parent shell"}) !== null);
// Now issue a getMore which will match the parallel shell's currentOp filter, signalling it to
// write a non-matching document into the collection. Confirm that we do not receive this
// document and that we subsequently time out.
-now = new Date();
cmdRes = db.runCommand(
{getMore: cmdRes.cursor.id, collection: collName, maxTimeMS: ReplSetTest.kDefaultTimeoutMS});
assert.commandWorked(cmdRes);
+jsTestLog("Waiting insertion shell to terminate...");
+assert.eq(insertshell(), 0);
+jsTestLog("Insertion shell terminated.");
assert.gt(cmdRes.cursor.id, NumberLong(0));
assert.eq(cmdRes.cursor.ns, coll.getFullName());
-assert.eq(cmdRes.cursor.nextBatch.length, 1);
+assert.eq(cmdRes.cursor.nextBatch.length,
+ 1,
+ 'Collection documents: ' + tojson(db.await_data.find({}).toArray()));
assert.docEq(cmdRes.cursor.nextBatch[0], {_id: "match", x: 1});
-insertshell();
})();