diff options
author | Vesselina Ratcheva <vesselina.ratcheva@10gen.com> | 2018-09-21 10:55:05 -0400 |
---|---|---|
committer | Vesselina Ratcheva <vesselina.ratcheva@10gen.com> | 2018-09-26 14:27:26 -0400 |
commit | 729a923ea4e0ba5518afb2efb0133aa5f5194391 (patch) | |
tree | 0fd5afae4f1bf24597fcdcab65f096446b34fda9 /jstests | |
parent | 54d601d3fd7297f71380178ee34029479edea944 (diff) | |
download | mongo-729a923ea4e0ba5518afb2efb0133aa5f5194391.tar.gz |
SERVER-35570 Improve robustness of backup_restore.js around dropping test database
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthrough/libs/backup_restore.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/jstests/noPassthrough/libs/backup_restore.js b/jstests/noPassthrough/libs/backup_restore.js index 65af92af13b..4641fcbb62d 100644 --- a/jstests/noPassthrough/libs/backup_restore.js +++ b/jstests/noPassthrough/libs/backup_restore.js @@ -196,7 +196,8 @@ var BackupRestoreTest = function(options) { }; var result = db.getSiblingDB('test').fsm_teardown.insert({a: 1}, wc); assert.writeOK(result, 'teardown insert failed: ' + tojson(result)); - result = db.getSiblingDB('test').fsm_teardown.drop(); + result = db.getSiblingDB('test').fsm_teardown.drop( + {writeConcern: {w: "majority"}}); assert(result, 'teardown drop failed'); }); } catch (e) { @@ -450,6 +451,8 @@ var BackupRestoreTest = function(options) { // Wait up to 5 minutes until the new hidden node is in state RECOVERING. rst.waitForState(hiddenNode, [ReplSetTest.State.RECOVERING, ReplSetTest.State.SECONDARY]); + jsTestLog('Stopping CRUD and FSM clients'); + // Stop CRUD client and FSM client. var crudStatus = checkProgram(crudPid); assert(crudStatus.alive, @@ -463,6 +466,14 @@ var BackupRestoreTest = function(options) { fsmStatus.exitCode); stopMongoProgramByPid(fsmPid); + // Make sure the test database is not in a drop-pending state. This can happen if we + // killed the FSM client while it was in the middle of dropping it. + assert.soonNoExcept(function() { + let result = primary.getDB("test").afterClientKills.insert( + {"a": 1}, {writeConcern: {w: "majority"}}); + return (result.nInserted === 1); + }, "failed to insert to test collection", 10 * 60 * 1000); + // Wait up to 5 minutes until the new hidden node is in state SECONDARY. jsTestLog('CRUD and FSM clients stopped. Waiting for hidden node ' + hiddenHost + ' to become SECONDARY'); |