summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorruslan.abdulkhalikov <ruslan.abdulkhalikov@mongodb.com>2022-02-07 20:29:33 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-08 00:04:34 +0000
commitaac0bcaa238ecb28dace7d263789608474edb3c6 (patch)
treef49612aedcc1037f09a6cad774583535faa37df5 /jstests
parentc8704d6c531f2eae407290d385a69d43f5af3b34 (diff)
downloadmongo-aac0bcaa238ecb28dace7d263789608474edb3c6.tar.gz
SERVER-60800 fix aggregation_cursor_invalidation tests
Diffstat (limited to 'jstests')
-rw-r--r--jstests/noPassthrough/aggregation_cursor_invalidations.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/jstests/noPassthrough/aggregation_cursor_invalidations.js b/jstests/noPassthrough/aggregation_cursor_invalidations.js
index 3ea8c54d90d..99e4b7e9a87 100644
--- a/jstests/noPassthrough/aggregation_cursor_invalidations.js
+++ b/jstests/noPassthrough/aggregation_cursor_invalidations.js
@@ -146,13 +146,10 @@ res = assert.commandWorked(testDB.runCommand({
foreignCollection.drop();
getMoreCollName = res.cursor.ns.substr(res.cursor.ns.indexOf('.') + 1);
res = testDB.runCommand({getMore: res.cursor.id, collection: getMoreCollName});
-assert.commandWorked(res,
- 'expected getMore to succeed despite the foreign collection being dropped');
-res.cursor.nextBatch.forEach(function(aggResult) {
- assert.eq(aggResult.results,
- [],
- 'expected results of $lookup into non-existent collection to be empty');
-});
+assert.commandFailedWithCode(
+ res,
+ ErrorCodes.NamespaceNotFound,
+ 'expected getMore to fail when the foreign collection has been dropped');
// Make sure the cursors were cleaned up.
assertNoOpenCursorsOnSourceCollection();
@@ -217,9 +214,10 @@ res = assert.commandWorked(testDB.runCommand({
foreignCollection.drop();
getMoreCollName = res.cursor.ns.substr(res.cursor.ns.indexOf('.') + 1);
res = testDB.runCommand({getMore: res.cursor.id, collection: getMoreCollName});
-assert.commandWorked(res,
- 'expected getMore to succeed despite the foreign collection being dropped');
-
+assert.commandFailedWithCode(
+ res,
+ ErrorCodes.NamespaceNotFound,
+ 'expected getMore to fail when the foreign collection has been dropped');
// Make sure the cursors were cleaned up.
assertNoOpenCursorsOnSourceCollection();
@@ -248,8 +246,10 @@ res = assert.commandWorked(testDB.runCommand({
foreignCollection.drop();
getMoreCollName = res.cursor.ns.substr(res.cursor.ns.indexOf('.') + 1);
res = testDB.runCommand({getMore: res.cursor.id, collection: getMoreCollName});
-assert.commandWorked(res,
- 'expected getMore to succeed despite the foreign collection being dropped');
+assert.commandFailedWithCode(
+ res,
+ ErrorCodes.NamespaceNotFound,
+ 'expected getMore to fail when the foreign collection has been dropped');
// Make sure the cursors were cleaned up.
assertNoOpenCursorsOnSourceCollection();