diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:42:24 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-26 18:42:24 -0400 |
commit | c1a45ebbb0530e3d0201321d725527f1eb83ffce (patch) | |
tree | f523079dc5ded3052eefbdcaae424b7502df5b25 /jstests/noPassthrough/index_killop_standalone.js | |
parent | c9599d8610c3da0b7c3da65667aff821063cf5b9 (diff) | |
download | mongo-c1a45ebbb0530e3d0201321d725527f1eb83ffce.tar.gz |
Apply formatting per `clang-format-7.0.1`
Diffstat (limited to 'jstests/noPassthrough/index_killop_standalone.js')
-rw-r--r-- | jstests/noPassthrough/index_killop_standalone.js | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/jstests/noPassthrough/index_killop_standalone.js b/jstests/noPassthrough/index_killop_standalone.js index fd1e4662859..2bb2376237b 100644 --- a/jstests/noPassthrough/index_killop_standalone.js +++ b/jstests/noPassthrough/index_killop_standalone.js @@ -2,47 +2,47 @@ * Confirms that both foreground and background index builds can be aborted using killop. */ (function() { - "use strict"; +"use strict"; - load('jstests/noPassthrough/libs/index_build.js'); +load('jstests/noPassthrough/libs/index_build.js'); - const conn = MongoRunner.runMongod(); - assert.neq(null, conn, "mongod was unable to start up"); +const conn = MongoRunner.runMongod(); +assert.neq(null, conn, "mongod was unable to start up"); - const testDB = conn.getDB("test"); - assert.commandWorked(testDB.dropDatabase()); - assert.writeOK(testDB.test.insert({a: 1})); - const coll = testDB.test; +const testDB = conn.getDB("test"); +assert.commandWorked(testDB.dropDatabase()); +assert.writeOK(testDB.test.insert({a: 1})); +const coll = testDB.test; - // Test that building an index with 'options' can be aborted using killop. - function testAbortIndexBuild(options) { - IndexBuildTest.pauseIndexBuilds(conn); +// Test that building an index with 'options' can be aborted using killop. +function testAbortIndexBuild(options) { + IndexBuildTest.pauseIndexBuilds(conn); - const createIdx = IndexBuildTest.startIndexBuild(conn, coll.getFullName(), {a: 1}, options); + const createIdx = IndexBuildTest.startIndexBuild(conn, coll.getFullName(), {a: 1}, options); - // When the index build starts, find its op id. - const opId = IndexBuildTest.waitForIndexBuildToStart(testDB); + // When the index build starts, find its op id. + const opId = IndexBuildTest.waitForIndexBuildToStart(testDB); - // Kill the index build. - assert.commandWorked(testDB.killOp(opId)); + // Kill the index build. + assert.commandWorked(testDB.killOp(opId)); - // Wait for the index build to stop. - try { - IndexBuildTest.waitForIndexBuildToStop(testDB); - } finally { - IndexBuildTest.resumeIndexBuilds(conn); - } + // Wait for the index build to stop. + try { + IndexBuildTest.waitForIndexBuildToStop(testDB); + } finally { + IndexBuildTest.resumeIndexBuilds(conn); + } - const exitCode = createIdx({checkExitSuccess: false}); - assert.neq( - 0, exitCode, 'expected shell to exit abnormally due to index build being terminated'); + const exitCode = createIdx({checkExitSuccess: false}); + assert.neq( + 0, exitCode, 'expected shell to exit abnormally due to index build being terminated'); - // Check that no new index has been created. This verifies that the index build was aborted - // rather than successfully completed. - IndexBuildTest.assertIndexes(coll, 1, ['_id_']); - } + // Check that no new index has been created. This verifies that the index build was aborted + // rather than successfully completed. + IndexBuildTest.assertIndexes(coll, 1, ['_id_']); +} - testAbortIndexBuild({background: true}); - testAbortIndexBuild({background: false}); - MongoRunner.stopMongod(conn); +testAbortIndexBuild({background: true}); +testAbortIndexBuild({background: false}); +MongoRunner.stopMongod(conn); })(); |