diff options
Diffstat (limited to 'jstests/noPassthrough')
6 files changed, 3 insertions, 51 deletions
diff --git a/jstests/noPassthrough/count_helper_read_preference.js b/jstests/noPassthrough/count_helper_read_preference.js index 28762ca26ee..17e702c2076 100644 --- a/jstests/noPassthrough/count_helper_read_preference.js +++ b/jstests/noPassthrough/count_helper_read_preference.js @@ -42,8 +42,7 @@ commandsRan = []; db.getMongo().setReadPref("secondary"); db.foo.count(); -// Check that we have wrapped the command and attached the read preference. +// Check that we have correctly attached the read preference to the command. assert.eq(commandsRan.length, 1); -assert.docEq(commandsRan[0].cmd, - {query: {count: "foo", query: {}}, $readPreference: {mode: "secondary"}}); +assert.docEq(commandsRan[0].cmd, {count: "foo", query: {}, $readPreference: {mode: "secondary"}}); })(); diff --git a/jstests/noPassthrough/implicit_sessions.js b/jstests/noPassthrough/implicit_sessions.js index 315f78cd5f1..4635aa26180 100644 --- a/jstests/noPassthrough/implicit_sessions.js +++ b/jstests/noPassthrough/implicit_sessions.js @@ -29,14 +29,6 @@ function inspectCommandForSessionId(func, {shouldIncludeId, expectedId, differen throw new Error("Mongo.prototype.runCommand() was never called: " + func.toString()); } - // If the command is in a wrapped form, then we look for the actual command object inside - // the query/$query object. - let cmdName = Object.keys(cmdObjSeen)[0]; - if (cmdName === "query" || cmdName === "$query") { - cmdObjSeen = cmdObjSeen[cmdName]; - cmdName = Object.keys(cmdObjSeen)[0]; - } - if (shouldIncludeId) { assert(cmdObjSeen.hasOwnProperty("lsid"), "Expected operation " + tojson(cmdObjSeen) + " to have a logical session id."); diff --git a/jstests/noPassthrough/shell_can_retry_writes.js b/jstests/noPassthrough/shell_can_retry_writes.js index a6f90bea6ab..8b7384abded 100644 --- a/jstests/noPassthrough/shell_can_retry_writes.js +++ b/jstests/noPassthrough/shell_can_retry_writes.js @@ -35,15 +35,6 @@ function testCommandCanBeRetried(func, expected = true) { throw new Error("Mongo.prototype.runCommand() was never called: " + func.toString()); } - let cmdName = Object.keys(cmdObjSeen)[0]; - - // If the command is in a wrapped form, then we look for the actual command object inside - // the query/$query object. - if (cmdName === "query" || cmdName === "$query") { - cmdObjSeen = cmdObjSeen[cmdName]; - cmdName = Object.keys(cmdObjSeen)[0]; - } - assert(cmdObjSeen.hasOwnProperty("lsid"), "Expected operation " + tojson(cmdObjSeen) + " to have a logical session id: " + func.toString()); diff --git a/jstests/noPassthrough/shell_can_use_read_concern.js b/jstests/noPassthrough/shell_can_use_read_concern.js index 82751f884b4..8f092efcf25 100644 --- a/jstests/noPassthrough/shell_can_use_read_concern.js +++ b/jstests/noPassthrough/shell_can_use_read_concern.js @@ -55,14 +55,6 @@ function runTests({withSession}) { let cmdName = Object.keys(cmdObjSeen)[0]; - // If the command is in a wrapped form, then we look for the actual command object - // inside - // the query/$query object. - if (cmdName === "query" || cmdName === "$query") { - cmdObjSeen = cmdObjSeen[cmdName]; - cmdName = Object.keys(cmdObjSeen)[0]; - } - if (expectedSession) { assert(cmdObjSeen.hasOwnProperty("lsid"), "Expected operation " + tojson(cmdObjSeen) + @@ -137,14 +129,6 @@ function runTests({withSession}) { }); testCommandCanBeCausallyConsistent(function() { - assert.commandWorked(db.runCommand({query: {count: coll.getName()}})); - }); - - testCommandCanBeCausallyConsistent(function() { - assert.commandWorked(db.runCommand({$query: {count: coll.getName()}})); - }); - - testCommandCanBeCausallyConsistent(function() { assert.eq(5, coll.count()); }); @@ -218,4 +202,4 @@ runTests({withSession: false}); runTests({withSession: true}); rst.stopSet(); -})(); +})();
\ No newline at end of file diff --git a/jstests/noPassthrough/shell_gossip_cluster_time.js b/jstests/noPassthrough/shell_gossip_cluster_time.js index dc46a1173a7..c9a47ce6ce7 100644 --- a/jstests/noPassthrough/shell_gossip_cluster_time.js +++ b/jstests/noPassthrough/shell_gossip_cluster_time.js @@ -41,15 +41,6 @@ function testCommandGossipedWithClusterTime(func, expectedClusterTime) { throw new Error("Mongo.prototype.runCommand() was never called: " + func.toString()); } - let cmdName = Object.keys(cmdObjSeen)[0]; - - // If the command is in a wrapped form, then we look for the actual command object inside - // the query/$query object. - if (cmdName === "query" || cmdName === "$query") { - cmdObjSeen = cmdObjSeen[cmdName]; - cmdName = Object.keys(cmdObjSeen)[0]; - } - if (expectedClusterTime === undefined) { assert(!cmdObjSeen.hasOwnProperty("$clusterTime"), "Expected operation " + tojson(cmdObjSeen) + diff --git a/jstests/noPassthrough/shell_retry_writes_uri.js b/jstests/noPassthrough/shell_retry_writes_uri.js index 640a8e8c80f..ce7bc61cbc3 100644 --- a/jstests/noPassthrough/shell_retry_writes_uri.js +++ b/jstests/noPassthrough/shell_retry_writes_uri.js @@ -23,11 +23,6 @@ function runShellScript(uri, cmdArgs, insertShouldHaveTxnNumber, shellFn) { let cmdObjSeen = cmdObj; let cmdName = Object.keys(cmdObjSeen)[0]; - if (cmdName === "query" || cmdName === "$query") { - cmdObjSeen = cmdObjSeen[cmdName]; - cmdName = Object.keys(cmdObj)[0]; - } - if (cmdName === "insert") { insertFound = true; if (insertShouldHaveTxnNumber) { |