summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/sync_write.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/sync_write.js')
-rw-r--r--jstests/noPassthrough/sync_write.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/jstests/noPassthrough/sync_write.js b/jstests/noPassthrough/sync_write.js
index 8908d6bad5e..a4c0d1ebe38 100644
--- a/jstests/noPassthrough/sync_write.js
+++ b/jstests/noPassthrough/sync_write.js
@@ -5,29 +5,29 @@
* @tags: [requires_persistence]
*/
(function() {
- 'use strict';
+'use strict';
- // The following test verifies that writeConcern: {j: true} ensures that data is durable.
- var dbpath = MongoRunner.dataPath + 'sync_write';
- resetDbpath(dbpath);
+// The following test verifies that writeConcern: {j: true} ensures that data is durable.
+var dbpath = MongoRunner.dataPath + 'sync_write';
+resetDbpath(dbpath);
- var mongodArgs = {dbpath: dbpath, noCleanData: true, journal: ''};
+var mongodArgs = {dbpath: dbpath, noCleanData: true, journal: ''};
- // Start a mongod.
- var conn = MongoRunner.runMongod(mongodArgs);
- assert.neq(null, conn, 'mongod was unable to start up');
+// Start a mongod.
+var conn = MongoRunner.runMongod(mongodArgs);
+assert.neq(null, conn, 'mongod was unable to start up');
- // Now connect to the mongod, do a journaled write and abruptly stop the server.
- var testDB = conn.getDB('test');
- assert.writeOK(testDB.synced.insert({synced: true}, {writeConcern: {j: true}}));
- MongoRunner.stopMongod(conn, 9, {allowedExitCode: MongoRunner.EXIT_SIGKILL});
+// Now connect to the mongod, do a journaled write and abruptly stop the server.
+var testDB = conn.getDB('test');
+assert.writeOK(testDB.synced.insert({synced: true}, {writeConcern: {j: true}}));
+MongoRunner.stopMongod(conn, 9, {allowedExitCode: MongoRunner.EXIT_SIGKILL});
- // Restart the mongod.
- conn = MongoRunner.runMongod(mongodArgs);
- assert.neq(null, conn, 'mongod was unable to restart after receiving a SIGKILL');
+// Restart the mongod.
+conn = MongoRunner.runMongod(mongodArgs);
+assert.neq(null, conn, 'mongod was unable to restart after receiving a SIGKILL');
- // Check that our journaled write still is present.
- testDB = conn.getDB('test');
- assert.eq(1, testDB.synced.count({synced: true}), 'synced write was not found');
- MongoRunner.stopMongod(conn);
+// Check that our journaled write still is present.
+testDB = conn.getDB('test');
+assert.eq(1, testDB.synced.count({synced: true}), 'synced write was not found');
+MongoRunner.stopMongod(conn);
})();