summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/repair2.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/repair2.js')
-rw-r--r--jstests/noPassthrough/repair2.js47
1 files changed, 25 insertions, 22 deletions
diff --git a/jstests/noPassthrough/repair2.js b/jstests/noPassthrough/repair2.js
index 58032bd17d4..74d75562ae8 100644
--- a/jstests/noPassthrough/repair2.js
+++ b/jstests/noPassthrough/repair2.js
@@ -1,32 +1,35 @@
// SERVER-2843 The repair command should not yield.
-baseName = "jstests_repair2";
+(function() {
+ "use strict";
+ const baseName = "jstests_repair2";
-load("jstests/libs/slow_weekly_util.js");
-testServer = new SlowWeeklyMongod(baseName);
+ const conn = MongoRunner.runMongod({smallfiles: "", nojournal: ""});
+ assert.neq(null, conn, "mongod failed to start.");
-t = testServer.getDB(baseName)[baseName];
-t.drop();
+ const t = conn.getDB(baseName)[baseName];
+ t.drop();
-var awaitShell = startParallelShell("db = db.getSiblingDB( '" + baseName + "');" +
- "for( i = 0; i < 10; ++i ) { " + "db.repairDatabase();" +
- "sleep( 5000 );" + " }",
- testServer.port);
+ var awaitShell = startParallelShell("db = db.getSiblingDB( '" + baseName + "');" +
+ "for( i = 0; i < 10; ++i ) { " +
+ "db.repairDatabase();" + "sleep( 5000 );" + " }",
+ conn.port);
-for (i = 0; i < 30; ++i) {
- var bulk = t.initializeOrderedBulkOp();
- for (j = 0; j < 5000; ++j) {
- bulk.insert({_id: j});
- }
+ for (let i = 0; i < 30; ++i) {
+ var bulk = t.initializeOrderedBulkOp();
+ for (let j = 0; j < 5000; ++j) {
+ bulk.insert({_id: j});
+ }
- for (j = 0; j < 5000; ++j) {
- bulk.find({_id: j, $isolated: 1}).remove();
- }
+ for (let j = 0; j < 5000; ++j) {
+ bulk.find({_id: j, $isolated: 1}).remove();
+ }
- assert.writeOK(bulk.execute());
- assert.eq(0, t.count());
-}
+ assert.writeOK(bulk.execute());
+ assert.eq(0, t.count());
+ }
-awaitShell();
+ awaitShell();
-testServer.stop();
+ MongoRunner.stopMongod(conn);
+})();