diff options
-rw-r--r-- | jstests/noPassthrough/libs/backup_restore.js | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/jstests/noPassthrough/libs/backup_restore.js b/jstests/noPassthrough/libs/backup_restore.js index 7eb5cd000ac..8acec46f193 100644 --- a/jstests/noPassthrough/libs/backup_restore.js +++ b/jstests/noPassthrough/libs/backup_restore.js @@ -202,6 +202,10 @@ var BackupRestoreTest = function(options) { jsTestLog("Backup restore " + tojson(options)); + // skipValidationOnNamespaceNotFound must be set to true for correct operation of this test. + assert(typeof TestData.skipValidationOnNamespaceNotFound === 'undefined' || + TestData.skipValidationOnNamespaceNotFound); + // Test options // Test name var testName = jsTest.name(); @@ -305,16 +309,10 @@ var BackupRestoreTest = function(options) { _runCmd(rsyncCmd); sleep(10000); } - // Set an option to skip 'ns not found' error during collection validation - // when shutting down mongod. - TestData.skipValidationOnNamespaceNotFound = true; // Stop the mongod process rst.stop(secondary.nodeId); - // Unset to allow future collection validation on stopMongod. - TestData.skipValidationOnNamespaceNotFound = false; - // One final rsync _runCmd(rsyncCmd); removeFile(hiddenDbpath + '/mongod.lock'); @@ -324,16 +322,9 @@ var BackupRestoreTest = function(options) { assert.gt(copiedFiles.length, 0, testName + ' no files copied'); rst.start(secondary.nodeId, {}, true); } else if (options.backup == 'stopStart') { - // Set an option to skip 'ns not found' error during collection validation - // when shutting down mongod. - TestData.skipValidationOnNamespaceNotFound = true; - // Stop the mongod process rst.stop(secondary.nodeId); - // Unset to allow future collection validation on stopMongod. - TestData.skipValidationOnNamespaceNotFound = false; - copyDbpath(dbpathSecondary, hiddenDbpath); removeFile(hiddenDbpath + '/mongod.lock'); print("Source directory:", tojson(ls(dbpathSecondary))); |