summaryrefslogtreecommitdiff
path: root/jstests/hooks
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2017-11-08 21:24:18 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2017-11-08 21:24:18 -0500
commit60110730980d1fbd24b07a4679c8d4ae7df4fc2e (patch)
treea83b4414a672c531c8c244b4dc2bce6d8e15c178 /jstests/hooks
parent9dec24bdf2e1f63b0fcba6a32763e97288583e5d (diff)
downloadmongo-60110730980d1fbd24b07a4679c8d4ae7df4fc2e.tar.gz
SERVER-31807 Add Powercycle task using writeConcern {w: "majority"}
Diffstat (limited to 'jstests/hooks')
-rw-r--r--jstests/hooks/crud_client.js26
1 files changed, 2 insertions, 24 deletions
diff --git a/jstests/hooks/crud_client.js b/jstests/hooks/crud_client.js
index a20cce5da69..248ee0e5d83 100644
--- a/jstests/hooks/crud_client.js
+++ b/jstests/hooks/crud_client.js
@@ -53,17 +53,6 @@ var numLoops = TestData.numLoops || 0;
print("****Starting CRUD client, namespace", dbName, collectionName, "numLoops", numLoops, "****");
var coll = db.getSiblingDB(dbName)[collectionName];
-var writeConcern = TestData.writeConcern || {};
-if (Object.keys(writeConcern).length) {
- coll.setWriteConcern = writeConcern;
-}
-
-var readConcern = TestData.readConcern || {};
-var noReadConcern = true;
-if (Object.keys(readConcern).length) {
- noReadConcern = false;
-}
-
coll.createIndex({x: 1});
var shouldLoopForever = numLoops <= 0;
@@ -103,28 +92,17 @@ while (shouldLoopForever || numLoops > 0) {
for (var i = 0; i < bulkNum; i++) {
bulk.insert({x: (match + i) % baseNum, doc: randString()});
}
- print("(" + collectionName + ") Bulk insert",
- bulkNum,
- "docs",
- tojsononeline(writeConcern),
- tojsononeline(bulk.execute(writeConcern)));
+ print(
+ "(" + collectionName + ") Bulk insert", bulkNum, "docs", tojsononeline(bulk.execute()));
} else if (operation == "count") {
var countOpts = {count: collectionName, query: {x: matchQuery}};
- if (!noReadConcern) {
- countOpts.readConcern = readConcern;
- }
print("(" + collectionName + ") Count docs",
tojsononeline(matchQuery),
- tojsononeline(readConcern),
tojsononeline(db.runCommand(countOpts)));
} else if (operation == "find") {
var findOpts = {find: collectionName, singleBatch: true, filter: {x: matchQuery}};
- if (!noReadConcern) {
- findOpts.readConcern = readConcern;
- }
print("(" + collectionName + ") Find docs",
tojsononeline(matchQuery),
- tojsononeline(readConcern),
"find status",
db.runCommand(findOpts).ok);
} else if (operation == "remove multi") {