diff options
author | Benety Goh <benety@mongodb.com> | 2017-06-20 19:22:03 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2017-06-22 05:57:12 -0400 |
commit | 67d75157ae993359575e5fb567557d82b016877e (patch) | |
tree | 18bfbec8180221229a0c7772dade9235e86f3175 /jstests/sharding/commands_that_write_accept_wc_configRS.js | |
parent | 48dc747414e18d8caa56f0fba23c80871f67c31a (diff) | |
download | mongo-67d75157ae993359575e5fb567557d82b016877e.tar.gz |
SERVER-29277 fixed commands_that_write_accept_wc_configRS.js to work with new dropDatabase two phase drops
Diffstat (limited to 'jstests/sharding/commands_that_write_accept_wc_configRS.js')
-rw-r--r-- | jstests/sharding/commands_that_write_accept_wc_configRS.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/jstests/sharding/commands_that_write_accept_wc_configRS.js b/jstests/sharding/commands_that_write_accept_wc_configRS.js index cd1e6c93e9b..89c273c77e1 100644 --- a/jstests/sharding/commands_that_write_accept_wc_configRS.js +++ b/jstests/sharding/commands_that_write_accept_wc_configRS.js @@ -93,10 +93,15 @@ load('jstests/multiVersion/libs/auth_helpers.js'); setupFunc: function() { coll.insert({type: 'oak'}); db.pine_needles.insert({type: 'pine'}); + // As of SERVER-29277, dropping a database with any replicated collections requires a + // majority of nodes to be able to complete the drop. Since this test case may run with + // less than a majority of nodes available, we empty out the database in the "setup" + // phase to allow the dropDatabase command to always run to completion. + db.pine_needles.drop(); + coll.drop(); }, confirmFunc: function() { - assert.eq(coll.find().itcount(), 0); - assert.eq(db.pine_needles.find().itcount(), 0); + assert.isnull(db.getMongo().getDBNames().find(dbName => dbName == db.getName())); }, requiresMajority: false, runsOnShards: true, @@ -111,10 +116,15 @@ load('jstests/multiVersion/libs/auth_helpers.js'); shardCollectionWithChunks(st, coll); coll.insert({type: 'oak', x: 11}); db.pine_needles.insert({type: 'pine'}); + // As of SERVER-29277, dropping a database with any replicated collections requires a + // majority of nodes to be able to complete the drop. Since this test case may run with + // less than a majority of nodes available, we empty out the database in the "setup" + // phase to allow the dropDatabase command to always run to completion. + db.pine_needles.drop(); + coll.drop(); }, confirmFunc: function() { - assert.eq(coll.find().itcount(), 0); - assert.eq(db.pine_needles.find().itcount(), 0); + assert.isnull(db.getMongo().getDBNames().find(dbName => dbName == db.getName())); }, requiresMajority: false, runsOnShards: true, |