summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/snapshot_reads.js
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2018-02-28 13:26:26 -0500
committerJames Wahlin <james@mongodb.com>2018-02-28 16:29:15 -0500
commitcba0d6e7087c9ddbb88997cf98de22439291e168 (patch)
treeb7a4af3a641edd121ed1eeb7f578d0740906c1fa /jstests/noPassthrough/snapshot_reads.js
parent1e89f1ba964d1989dfef74e189926d47a5c930c9 (diff)
downloadmongo-cba0d6e7087c9ddbb88997cf98de22439291e168.tar.gz
SERVER-33544 snapshot_reads.js should check for storage engine support once after ReplSetTest start
Diffstat (limited to 'jstests/noPassthrough/snapshot_reads.js')
-rw-r--r--jstests/noPassthrough/snapshot_reads.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/jstests/noPassthrough/snapshot_reads.js b/jstests/noPassthrough/snapshot_reads.js
index 8f17d25e8b8..ca1ec5b0e0a 100644
--- a/jstests/noPassthrough/snapshot_reads.js
+++ b/jstests/noPassthrough/snapshot_reads.js
@@ -10,19 +10,19 @@
rst.startSet();
rst.initiate();
+ const primaryDB = rst.getPrimary().getDB(dbName);
+ if (!primaryDB.serverStatus().storageEngine.supportsSnapshotReadConcern) {
+ rst.stopSet();
+ return;
+ }
+
function runTest({useCausalConsistency}) {
- const primaryDB = rst.getPrimary().getDB(dbName);
primaryDB.coll.drop();
const session =
primaryDB.getMongo().startSession({causalConsistency: useCausalConsistency});
const sessionDb = session.getDatabase(dbName);
- if (!primaryDB.serverStatus().storageEngine.supportsSnapshotReadConcern) {
- rst.stopSet();
- return;
- }
-
const bulk = primaryDB.coll.initializeUnorderedBulkOp();
for (let x = 0; x < 10; ++x) {
bulk.insert({_id: x});