summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/logical_session_cache_find_getmore.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/logical_session_cache_find_getmore.js')
-rw-r--r--jstests/noPassthrough/logical_session_cache_find_getmore.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/jstests/noPassthrough/logical_session_cache_find_getmore.js b/jstests/noPassthrough/logical_session_cache_find_getmore.js
index a005b1c0ef5..4857443d032 100644
--- a/jstests/noPassthrough/logical_session_cache_find_getmore.js
+++ b/jstests/noPassthrough/logical_session_cache_find_getmore.js
@@ -1,28 +1,28 @@
(function() {
- 'use strict';
+'use strict';
- TestData.disableImplicitSessions = true;
+TestData.disableImplicitSessions = true;
- var conn = MongoRunner.runMongod({setParameter: {maxSessions: 2}});
- var testDB = conn.getDB("test");
+var conn = MongoRunner.runMongod({setParameter: {maxSessions: 2}});
+var testDB = conn.getDB("test");
- assert.writeOK(testDB.foo.insert({data: 1}));
- assert.writeOK(testDB.foo.insert({data: 2}));
+assert.writeOK(testDB.foo.insert({data: 1}));
+assert.writeOK(testDB.foo.insert({data: 2}));
- for (var i = 0; i < 2; i++) {
- var session = conn.startSession();
- var db = session.getDatabase("test");
- var res = assert.commandWorked(db.runCommand({find: "foo", batchSize: 1}),
- "unable to run find when the cache is not full");
- var cursorId = res.cursor.id;
- assert.commandWorked(db.runCommand({getMore: cursorId, collection: "foo"}),
- "unable to run getMore when the cache is not full");
- }
+for (var i = 0; i < 2; i++) {
+ var session = conn.startSession();
+ var db = session.getDatabase("test");
+ var res = assert.commandWorked(db.runCommand({find: "foo", batchSize: 1}),
+ "unable to run find when the cache is not full");
+ var cursorId = res.cursor.id;
+ assert.commandWorked(db.runCommand({getMore: cursorId, collection: "foo"}),
+ "unable to run getMore when the cache is not full");
+}
- var session3 = conn.startSession();
- var db = session3.getDatabase("test");
- assert.commandFailed(db.runCommand({find: "foo", batchSize: 1}),
- "able to run find when the cache is full");
+var session3 = conn.startSession();
+var db = session3.getDatabase("test");
+assert.commandFailed(db.runCommand({find: "foo", batchSize: 1}),
+ "able to run find when the cache is full");
- MongoRunner.stopMongod(conn);
+MongoRunner.stopMongod(conn);
})();