From feba30fcecb0e4e084447e4a41f67576d11799d9 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 23 Oct 2017 14:21:46 +0200 Subject: [PATCH] attempt to make replication test more deterministic (#3482) --- .../tests/replication/replication-ongoing-global.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/server/tests/replication/replication-ongoing-global.js b/js/server/tests/replication/replication-ongoing-global.js index c31b4a00e8..13db632f48 100644 --- a/js/server/tests/replication/replication-ongoing-global.js +++ b/js/server/tests/replication/replication-ongoing-global.js @@ -867,23 +867,24 @@ function ReplicationOtherDBSuite() { }; setupReplication(); + + db._useDatabase("_system"); + connectToSlave(); + // wait until database is present on slave as well + waitUntil(function() { return (db._databases().indexOf(dbName) !== -1); }); // Section - Master // Now do the evil stuff: drop the database that is replicating from right now. connectToMaster(); - db._useDatabase("_system"); - - waitUntil(function() { return (db._databases().indexOf(dbName) !== -1); }); - // This shall not fail. db._dropDatabase(dbName); + db._useDatabase("_system"); connectToSlave(); waitUntil(function() { return (db._databases().indexOf(dbName) === -1); }); // Now recreate a new database with this name connectToMaster(); - db._useDatabase("_system"); db._createDatabase(dbName); db._useDatabase(dbName); @@ -891,8 +892,8 @@ function ReplicationOtherDBSuite() { db._collection(cn).save(docs); // Section - Slave - connectToSlave(); db._useDatabase("_system"); + connectToSlave(); waitUntil(function() { return (db._databases().indexOf(dbName) !== -1); }); // database now present on slave