diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-08-23 09:12:45 -0400 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-08-23 09:12:45 -0400 |
commit | e51927f743d0b5bf13e13873f7cfcc1cf07c967a (patch) | |
tree | af7118bdb822e8760b41b63a50d730ac8d2307b8 /jstests/change_streams/whole_cluster.js | |
parent | aea948bf0f6c85b385f24f6c5de725b5c3c1335b (diff) | |
download | mongo-e51927f743d0b5bf13e13873f7cfcc1cf07c967a.tar.gz |
Revert "SERVER-33272 Proactively close newly empty databases"
This reverts commit b6b81f34516ba7b1472cb1dd319da8785f24ae58.
Diffstat (limited to 'jstests/change_streams/whole_cluster.js')
-rw-r--r-- | jstests/change_streams/whole_cluster.js | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/jstests/change_streams/whole_cluster.js b/jstests/change_streams/whole_cluster.js index f9c47ee1c4f..a1cc114cd9a 100644 --- a/jstests/change_streams/whole_cluster.js +++ b/jstests/change_streams/whole_cluster.js @@ -11,12 +11,6 @@ db = db.getSiblingDB(jsTestName()); const adminDB = db.getSiblingDB("admin"); const otherDB = db.getSiblingDB(jsTestName() + "_other"); -// Create additional collections to prevent the databases from being closed when the other -// collections are dropped. -assert.commandWorkedOrFailedWithCode(db.createCollection("unused"), ErrorCodes.NamespaceExists); -assert.commandWorkedOrFailedWithCode(otherDB.createCollection("unused"), - ErrorCodes.NamespaceExists); - // Drop and recreate the collections to be used in this set of tests. assertDropAndRecreateCollection(db, "t1"); assertDropAndRecreateCollection(otherDB, "t2"); @@ -71,13 +65,12 @@ const validUserDBs = [ "_config_" ]; validUserDBs.forEach(dbName => { - const collName = "test" + Random.srand(); - assert.commandWorked(db.getSiblingDB(dbName).getCollection(collName).insert({_id: 0, a: 1})); + assert.commandWorked(db.getSiblingDB(dbName).test.insert({_id: 0, a: 1})); expected = [ { documentKey: {_id: 0}, fullDocument: {_id: 0, a: 1}, - ns: {db: dbName, coll: collName}, + ns: {db: dbName, coll: "test"}, operationType: "insert", }, ]; @@ -108,9 +101,7 @@ filteredDBs.forEach(dbName => { if (FixtureHelpers.isMongos(db) && dbName == "local") return; - const collName = "test" + Random.srand(); - assert.commandWorked(db.getSiblingDB(dbName).getCollection(collName).insert({_id: 0, a: 1})); - + assert.commandWorked(db.getSiblingDB(dbName).test.insert({_id: 0, a: 1})); // Insert to the test collection to ensure that the change stream has something to // return. assert.commandWorked(db.t1.insert({_id: dbName})); @@ -125,7 +116,7 @@ filteredDBs.forEach(dbName => { cst.assertNextChangesEqual({cursor: cursor, expectedChanges: expected}); // Drop the test collection to avoid duplicate key errors if this test is run multiple // times. - assertDropCollection(db.getSiblingDB(dbName), collName); + assertDropCollection(db.getSiblingDB(dbName), "test"); }); // Dropping a database should generate drop entries for each collection followed by a database |