diff options
Diffstat (limited to 'jstests/change_streams/whole_db_resumability.js')
-rw-r--r-- | jstests/change_streams/whole_db_resumability.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/jstests/change_streams/whole_db_resumability.js b/jstests/change_streams/whole_db_resumability.js index 2e2c0e183ec..725035c193c 100644 --- a/jstests/change_streams/whole_db_resumability.js +++ b/jstests/change_streams/whole_db_resumability.js @@ -9,8 +9,13 @@ load("jstests/libs/collection_drop_recreate.js"); // For assert[Drop|Create]Col load("jstests/libs/change_stream_util.js"); // For ChangeStreamTest. load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers. -// Drop and recreate the collections to be used in this set of tests. const testDB = db.getSiblingDB(jsTestName()); + +// Create an additional collection to prevent the database from being closed when the other +// collection is dropped. +assert.commandWorkedOrFailedWithCode(testDB.createCollection("unused"), ErrorCodes.NamespaceExists); + +// Drop and recreate the collections to be used in this set of tests. let coll = assertDropAndRecreateCollection(testDB, "resume_coll"); const otherColl = assertDropAndRecreateCollection(testDB, "resume_coll_other"); |