From 03f89bb1588cfa2592586e4fbabc6eb14edd6591 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Wed, 25 Apr 2018 07:53:19 -0400 Subject: SERVER-25640 terminate running processes in jstests (cherry picked from commit c556e377094792e7253a95cb5fedcd703a99bf2c) --- jstests/noPassthroughWithMongod/clonecollection.js | 2 ++ jstests/noPassthroughWithMongod/host_connection_string_validation.js | 1 + jstests/noPassthroughWithMongod/indexbg_interrupts.js | 1 + jstests/noPassthroughWithMongod/indexbg_restart_secondary.js | 1 + jstests/noPassthroughWithMongod/ipv6_connection_string_validation.js | 1 + jstests/noPassthroughWithMongod/mr_noscripting.js | 1 + jstests/noPassthroughWithMongod/newcollection2.js | 1 + jstests/noPassthroughWithMongod/replset_host_connection_validation.js | 1 + jstests/noPassthroughWithMongod/server7428.js | 2 ++ 9 files changed, 11 insertions(+) (limited to 'jstests/noPassthroughWithMongod') diff --git a/jstests/noPassthroughWithMongod/clonecollection.js b/jstests/noPassthroughWithMongod/clonecollection.js index 2c7cf24ea9a..9bcd168ed11 100644 --- a/jstests/noPassthroughWithMongod/clonecollection.js +++ b/jstests/noPassthroughWithMongod/clonecollection.js @@ -64,3 +64,5 @@ assert.commandWorked(f.createView("viewA", "a", [])); assert.commandFailedWithCode(t.cloneCollection("localhost:" + fromMongod.port, "viewA"), ErrorCodes.CommandNotSupportedOnView, "cloneCollection on view expected to fail"); +MongoRunner.stopMongod(fromMongod); +MongoRunner.stopMongod(toMongod); diff --git a/jstests/noPassthroughWithMongod/host_connection_string_validation.js b/jstests/noPassthroughWithMongod/host_connection_string_validation.js index f7bac51db88..b4cc778b3a5 100644 --- a/jstests/noPassthroughWithMongod/host_connection_string_validation.js +++ b/jstests/noPassthroughWithMongod/host_connection_string_validation.js @@ -25,6 +25,7 @@ var exitCode = _runMongoProgram.apply(null, args); jsTest.log("Inner mode test finished, exit code was " + exitCode); + MongoRunner.stopMongod(mongod); // Pass the inner test's exit code back as the outer test's exit code if (exitCode != 0) { doassert("inner test failed with exit code " + exitcode); diff --git a/jstests/noPassthroughWithMongod/indexbg_interrupts.js b/jstests/noPassthroughWithMongod/indexbg_interrupts.js index 3e0601a9bce..a1d5bc848b8 100644 --- a/jstests/noPassthroughWithMongod/indexbg_interrupts.js +++ b/jstests/noPassthroughWithMongod/indexbg_interrupts.js @@ -99,3 +99,4 @@ for (var idx = 0; idx < dropAction.length; idx++) { }, "secondary did not drop index for " + dc.toString()); } jsTest.log("indexbg-interrupts.js done"); +replTest.stopSet(); diff --git a/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js b/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js index 26b8083de75..03963fdb223 100644 --- a/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js +++ b/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js @@ -75,4 +75,5 @@ assert.soon(function() { return 2 == secondDB.getCollection(collectionName).getIndexes().length; }, "Index build not resumed after restart", 30000, 50); + replTest.stopSet(); }()); diff --git a/jstests/noPassthroughWithMongod/ipv6_connection_string_validation.js b/jstests/noPassthroughWithMongod/ipv6_connection_string_validation.js index 6d80b2aec70..5014ab3fc60 100644 --- a/jstests/noPassthroughWithMongod/ipv6_connection_string_validation.js +++ b/jstests/noPassthroughWithMongod/ipv6_connection_string_validation.js @@ -32,6 +32,7 @@ if (exitCode != 0) { doassert("inner test failed with exit code " + exitcode); } + MongoRunner.stopMongod(mongod); return; } diff --git a/jstests/noPassthroughWithMongod/mr_noscripting.js b/jstests/noPassthroughWithMongod/mr_noscripting.js index 7a6ca1555a8..59d16e37627 100644 --- a/jstests/noPassthroughWithMongod/mr_noscripting.js +++ b/jstests/noPassthroughWithMongod/mr_noscripting.js @@ -19,3 +19,4 @@ assert.eq(0, mrResult.ok, 'mr result: ' + tojson(mrResult)); // Confirm that mongod did not crash var cmdResult = testDB.adminCommand({serverStatus: 1}); assert(cmdResult.ok, 'serverStatus failed, result: ' + tojson(cmdResult)); +MongoRunner.stopMongod(conn); diff --git a/jstests/noPassthroughWithMongod/newcollection2.js b/jstests/noPassthroughWithMongod/newcollection2.js index 46cd1316c90..dd5522e2456 100644 --- a/jstests/noPassthroughWithMongod/newcollection2.js +++ b/jstests/noPassthroughWithMongod/newcollection2.js @@ -15,3 +15,4 @@ assert(v.valid); db.runCommand({applyOps: [{op: 'u', ns: 'a\0b'}]}); var res = db["a\0a"].insert({}); assert(res.hasWriteError(), "A write to collection a\0a succceeded"); +MongoRunner.stopMongod(m); diff --git a/jstests/noPassthroughWithMongod/replset_host_connection_validation.js b/jstests/noPassthroughWithMongod/replset_host_connection_validation.js index e65387dd705..10c3af2b460 100644 --- a/jstests/noPassthroughWithMongod/replset_host_connection_validation.js +++ b/jstests/noPassthroughWithMongod/replset_host_connection_validation.js @@ -25,6 +25,7 @@ const exitCode = _runMongoProgram(...args); jsTest.log("Inner mode test finished, exit code was " + exitCode); + replTest.stopSet(); // Pass the inner test's exit code back as the outer test's exit code if (exitCode != 0) { doassert("inner test failed with exit code " + exitCode); diff --git a/jstests/noPassthroughWithMongod/server7428.js b/jstests/noPassthroughWithMongod/server7428.js index 745f11021f4..7b5278a10e1 100644 --- a/jstests/noPassthroughWithMongod/server7428.js +++ b/jstests/noPassthroughWithMongod/server7428.js @@ -19,4 +19,6 @@ admin.copyDatabase('test', 'test', fromDb.host); + MongoRunner.stopMongod(fromDb); + MongoRunner.stopMongod(toDb); })(); -- cgit v1.2.1