diff options
Diffstat (limited to 'jstests/noPassthrough/crud_timestamps.js')
-rw-r--r-- | jstests/noPassthrough/crud_timestamps.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/jstests/noPassthrough/crud_timestamps.js b/jstests/noPassthrough/crud_timestamps.js index cb7986d7bc9..3157e2a265a 100644 --- a/jstests/noPassthrough/crud_timestamps.js +++ b/jstests/noPassthrough/crud_timestamps.js @@ -31,20 +31,16 @@ const sessionDb = session.getDatabase(dbName); const response = assert.commandWorked(testDB.createCollection("coll")); const startTime = response.operationTime; - let txnNumber = 0; function check(atClusterTime, expected) { + session.startTransaction({readConcern: {level: "snapshot", atClusterTime: atClusterTime}}); // Check both a collection scan and scanning the _id index. [{$natural: 1}, {_id: 1}].forEach(sort => { - let response = assert.commandWorked(sessionDb.runCommand({ - find: collName, - sort: sort, - readConcern: {level: "snapshot", atClusterTime: atClusterTime}, - txnNumber: NumberLong(txnNumber++), - singleBatch: true - })); + let response = assert.commandWorked( + sessionDb.runCommand({find: collName, sort: sort, singleBatch: true})); assert.eq(expected, response.cursor.firstBatch); }); + session.commitTransaction(); } // insert |