Skip to content

Commit 8d273a1

Browse files
committed
Added setimeout to let db drop replicate
1 parent 276ccd3 commit 8d273a1

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

test/db_test.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,24 +1396,27 @@ exports.shouldCorrectlyShowTheResultsFromIndexInformation = function(test) {
13961396
db.dropDatabase(function(err, result) {
13971397
test.equal(null, err);
13981398

1399-
// Get the admin database
1400-
db.admin().listDatabases(function(err, dbs) {
1401-
// Grab the databases
1402-
dbs = dbs.databases;
1403-
// Did we find the db
1404-
var found = false;
1399+
// Wait to seconds to let it replicate across
1400+
setTimeout(function() {
1401+
// Get the admin database
1402+
db.admin().listDatabases(function(err, dbs) {
1403+
// Grab the databases
1404+
dbs = dbs.databases;
1405+
// Did we find the db
1406+
var found = false;
1407+
1408+
// Check if we have the db in the list
1409+
for(var i = 0; i < dbs.length; i++) {
1410+
if(dbs[i].name == 'integration_tests_to_drop') found = true;
1411+
}
1412+
1413+
// We should not find the databases
1414+
if(process.env['JENKINS'] == null) test.equal(false, found);
14051415

1406-
// Check if we have the db in the list
1407-
for(var i = 0; i < dbs.length; i++) {
1408-
if(dbs[i].name == 'integration_tests_to_drop') found = true;
1409-
}
1410-
1411-
// We should not find the databases
1412-
if(process.env['JENKINS'] == null) test.equal(false, found);
1413-
1414-
db.close();
1415-
test.done();
1416-
});
1416+
db.close();
1417+
test.done();
1418+
});
1419+
}, 2000);
14171420
});
14181421
});
14191422
});

0 commit comments

Comments
 (0)