From 46d914bc91a5224bda0a715c15fc440d903c9ba2 Mon Sep 17 00:00:00 2001 From: Ali Mir Date: Tue, 23 Feb 2021 18:59:42 +0000 Subject: [PATCH] SERVER-54674 Use separate replica set test fixtures for each test run in awaitable_hello_fcv_change.js --- .../replsets/awaitable_hello_fcv_change.js | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/jstests/replsets/awaitable_hello_fcv_change.js b/jstests/replsets/awaitable_hello_fcv_change.js index e814c79a207..3af3922b754 100644 --- a/jstests/replsets/awaitable_hello_fcv_change.js +++ b/jstests/replsets/awaitable_hello_fcv_change.js @@ -10,15 +10,6 @@ load("jstests/libs/parallel_shell_helpers.js"); load("jstests/libs/fail_point_util.js"); -const rst = new ReplSetTest({nodes: [{}, {rsConfig: {priority: 0, votes: 0}}]}); -rst.startSet(); -rst.initiate(); - -const primary = rst.getPrimary(); -const secondary = rst.getSecondary(); -const primaryAdminDB = primary.getDB("admin"); -const secondaryAdminDB = secondary.getDB("admin"); - function runAwaitableHelloBeforeFCVChange( topologyVersionField, targetFCV, isPrimary, prevMinWireVersion, serverMaxWireVersion) { const isUseSecondaryDelaySecsEnabled = db.adminCommand({ @@ -77,6 +68,15 @@ function runAwaitableHelloBeforeFCVChange( function runTest(downgradeFCV) { jsTestLog("Running test with downgradeFCV: " + downgradeFCV); + const rst = new ReplSetTest({nodes: [{}, {rsConfig: {priority: 0, votes: 0}}]}); + rst.startSet(); + rst.initiate(); + + const primary = rst.getPrimary(); + const secondary = rst.getSecondary(); + const primaryAdminDB = primary.getDB("admin"); + const secondaryAdminDB = secondary.getDB("admin"); + // This test manually runs hello with the 'internalClient' field, which means that to the // mongod, the connection appears to be from another server. This makes mongod to return an // hello response with a real 'minWireVersion' for internal clients instead of 0. @@ -334,10 +334,9 @@ function runTest(downgradeFCV) { secondaryAdminDB.serverStatus().connections.awaitingTopologyChanges; assert.eq(0, numAwaitingTopologyChangeOnPrimary); assert.eq(0, numAwaitingTopologyChangeOnSecondary); + rst.stopSet(); } runTest(lastLTSFCV); runTest(lastContinuousFCV); - -rst.stopSet(); })();