summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorTed Tuckman <ted.tuckman@mongodb.com>2018-09-27 15:06:56 -0400
committerTed Tuckman <ted.tuckman@mongodb.com>2018-10-02 13:09:24 -0400
commit25de6274b865e1ebe75c4a8c0f8f5540b364eff0 (patch)
tree67b8d83c426b3ee012123e7e9f0376f219e0b4ff /jstests
parent6c5a7bb094cae90823bd05d8d21074cf2ea79990 (diff)
downloadmongo-25de6274b865e1ebe75c4a8c0f8f5540b364eff0.tar.gz
SERVER-37006 Move originatingCommand from currentOp inprog to cursor object
Diffstat (limited to 'jstests')
-rw-r--r--jstests/change_streams/only_wake_getmore_for_relevant_changes.js2
-rw-r--r--jstests/core/awaitdata_getmore_cmd.js18
-rw-r--r--jstests/noPassthrough/currentop_query.js16
-rw-r--r--jstests/noPassthrough/read_concern_snapshot_yielding.js4
-rw-r--r--jstests/sharding/aggregation_currentop.js3
5 files changed, 23 insertions, 20 deletions
diff --git a/jstests/change_streams/only_wake_getmore_for_relevant_changes.js b/jstests/change_streams/only_wake_getmore_for_relevant_changes.js
index cbafe90076e..bdd45a4d1f4 100644
--- a/jstests/change_streams/only_wake_getmore_for_relevant_changes.js
+++ b/jstests/change_streams/only_wake_getmore_for_relevant_changes.js
@@ -35,7 +35,7 @@ assert.writeOK(db.getCollection("${ shellSentinelCollection.getName() }").insert
assert.soon(function() {
return db.currentOp({
op: "getmore",
- "originatingCommand.comment": "${identifyingComment}",
+ "cursor.originatingCommand.comment": "${identifyingComment}",
}).inprog.length > 0;
});
diff --git a/jstests/core/awaitdata_getmore_cmd.js b/jstests/core/awaitdata_getmore_cmd.js
index 0b006624f9b..1b417e7a8f1 100644
--- a/jstests/core/awaitdata_getmore_cmd.js
+++ b/jstests/core/awaitdata_getmore_cmd.js
@@ -163,20 +163,22 @@
assert.writeOK(db.await_data.insert({_id: "signal parent shell"}));
// Wait for the parent shell to start watching for the next document.
- assert.soon(
- () => db.currentOp({op: "getmore", "originatingCommand.comment": "uniquifier_comment"})
- .inprog.length == 1,
- () => tojson(db.currentOp().inprog));
+ assert.soon(() => db.currentOp({
+ op: "getmore",
+ "cursor.originatingCommand.comment": "uniquifier_comment"
+ }).inprog.length == 1,
+ () => tojson(db.currentOp().inprog));
// Now write a non-matching document to the collection.
assert.writeOK(db.await_data.insert({_id: "no match", x: 0}));
// Make sure the getMore has not ended after a while.
sleep(2000);
- assert.eq(db.currentOp({op: "getmore", "originatingCommand.comment": "uniquifier_comment"})
- .inprog.length,
- 1,
- tojson(db.currentOp().inprog));
+ assert.eq(
+ db.currentOp({op: "getmore", "cursor.originatingCommand.comment": "uniquifier_comment"})
+ .inprog.length,
+ 1,
+ tojson(db.currentOp().inprog));
// Now write a matching document to wake it up.
assert.writeOK(db.await_data.insert({_id: "match", x: 1}));
diff --git a/jstests/noPassthrough/currentop_query.js b/jstests/noPassthrough/currentop_query.js
index 81874253088..b2aa9b2284f 100644
--- a/jstests/noPassthrough/currentop_query.js
+++ b/jstests/noPassthrough/currentop_query.js
@@ -35,7 +35,7 @@
// zero-batch cursors and only hit the failpoints on the following getMore. This helper takes a
// generic command object and creates an appropriate filter given the use-case.
function commandOrOriginatingCommand(cmdObj, isRemoteShardCurOp) {
- const cmdFieldName = (isRemoteShardCurOp ? "originatingCommand" : "command");
+ const cmdFieldName = (isRemoteShardCurOp ? "cursor.originatingCommand" : "command");
const cmdFilter = {};
for (let subFieldName in cmdObj) {
cmdFilter[`${cmdFieldName}.${subFieldName}`] = cmdObj[subFieldName];
@@ -410,8 +410,8 @@
const filter = {
"command.getMore":
(isRemoteShardCurOp ? {$gt: 0} : TestData.commandResult.cursor.id),
- [`originatingCommand.${cmdName}`]:
- {$exists: true}, "originatingCommand.comment": "currentop_query"
+ [`cursor.originatingCommand.${cmdName}`]:
+ {$exists: true}, "cursor.originatingCommand.comment": "currentop_query"
};
confirmCurrentOpContents({
@@ -436,9 +436,9 @@
"command.getMore": {$gt: 0},
"command.collection": "currentop_query",
"command.batchSize": 2,
- "originatingCommand.find": "currentop_query",
- "originatingCommand.ntoreturn": 2,
- "originatingCommand.comment": "currentop_query"
+ "cursor.originatingCommand.find": "currentop_query",
+ "cursor.originatingCommand.ntoreturn": 2,
+ "cursor.originatingCommand.comment": "currentop_query"
};
confirmCurrentOpContents({
@@ -559,8 +559,8 @@
currentOpFilter = {
"command.getMore":
(isRemoteShardCurOp ? {$gt: 0} : TestData.commandResult.cursor.id),
- "originatingCommand.$truncated": {$regex: truncatedQueryString},
- "originatingCommand.comment": "currentop_query"
+ "cursor.originatingCommand.$truncated": {$regex: truncatedQueryString},
+ "cursor.originatingCommand.comment": "currentop_query"
};
confirmCurrentOpContents({
diff --git a/jstests/noPassthrough/read_concern_snapshot_yielding.js b/jstests/noPassthrough/read_concern_snapshot_yielding.js
index 36b0ba7c2a2..83637bae9a4 100644
--- a/jstests/noPassthrough/read_concern_snapshot_yielding.js
+++ b/jstests/noPassthrough/read_concern_snapshot_yielding.js
@@ -229,7 +229,7 @@
session.commitTransaction();
assert.eq(
res.cursor.nextBatch.length, TestData.numDocs - initialFindBatchSize, tojson(res));
- }, {"originatingCommand.filter": {x: 1}});
+ }, {"cursor.originatingCommand.filter": {x: 1}});
// Test aggregate.
testCommand(function() {
@@ -262,7 +262,7 @@
session.commitTransaction();
assert.eq(
res.cursor.nextBatch.length, TestData.numDocs - initialFindBatchSize, tojson(res));
- }, {"originatingCommand.filter": {x: 1}});
+ }, {"cursor.originatingCommand.filter": {x: 1}});
// Test distinct.
testCommand(function() {
diff --git a/jstests/sharding/aggregation_currentop.js b/jstests/sharding/aggregation_currentop.js
index 3572285ce79..965ead4d15b 100644
--- a/jstests/sharding/aggregation_currentop.js
+++ b/jstests/sharding/aggregation_currentop.js
@@ -373,7 +373,8 @@ TestData.skipAwaitingReplicationOnShardsBeforeCheckingUUIDs = true;
assert.gte(adminDB.currentOp({$ownOps: false, $all: true, active: false}).inprog.length, 1);
// Test that collation rules apply to matches on $currentOp output.
- const matchField = (isRemoteShardCurOp ? "originatingCommand.comment" : "command.comment");
+ const matchField =
+ (isRemoteShardCurOp ? "cursor.originatingCommand.comment" : "command.comment");
const numExpectedMatches = (isRemoteShardCurOp ? stParams.shards : 1);
assert.eq(