diff options
author | Ian Boros <ian.boros@10gen.com> | 2018-04-13 14:10:32 -0400 |
---|---|---|
committer | Ian Boros <ian.boros@10gen.com> | 2018-04-13 15:00:05 -0400 |
commit | 0832d6499259a503e9af506e3e4ab42a535a1121 (patch) | |
tree | a0b4cddc9cbbd2618ff519aafd6ebc0c1f575deb /jstests/change_streams | |
parent | fdf8652adbe54c3e60df075560b22a1cca0bdc40 (diff) | |
download | mongo-0832d6499259a503e9af506e3e4ab42a535a1121.tar.gz |
SERVER-34467 make sure tests create databases before starting change streams
Diffstat (limited to 'jstests/change_streams')
3 files changed, 9 insertions, 9 deletions
diff --git a/jstests/change_streams/change_stream_start_at_cluster_time.js b/jstests/change_streams/change_stream_start_at_cluster_time.js index aad1b38a7cc..dc6f64bb551 100644 --- a/jstests/change_streams/change_stream_start_at_cluster_time.js +++ b/jstests/change_streams/change_stream_start_at_cluster_time.js @@ -1,11 +1,9 @@ // Tests resuming change streams based on cluster time. (function() { "use strict"; + load("jstests/libs/collection_drop_recreate.js"); // For assert[Drop|Create]Collection. - const coll = db[jsTestName()]; - coll.drop(); - - assert.commandWorked(db.createCollection(coll.getName())); + const coll = assertDropAndRecreateCollection(db, jsTestName()); const testStartTime = db.runCommand({isMaster: 1}).$clusterTime.clusterTime; diff --git a/jstests/change_streams/change_stream_whole_db_resumability.js b/jstests/change_streams/change_stream_whole_db_resumability.js index fa6cd369f75..682d0546cb7 100644 --- a/jstests/change_streams/change_stream_whole_db_resumability.js +++ b/jstests/change_streams/change_stream_whole_db_resumability.js @@ -5,10 +5,9 @@ load("jstests/libs/collection_drop_recreate.js"); // For assert[Drop|Create]Collection. load("jstests/libs/change_stream_util.js"); // For ChangeStreamTest. - const coll = db[jsTestName() + "resume_coll"]; - const otherColl = db[jsTestName() + "resume_coll_other"]; - coll.drop(); - otherColl.drop(); + // Drop and recreate the collections to be used in this set of tests. + const coll = assertDropAndRecreateCollection(db, jsTestName() + "resume_coll"); + const otherColl = assertDropAndRecreateCollection(db, jsTestName() + "resume_coll_other"); let cst = new ChangeStreamTest(db); let resumeCursor = cst.startWatchingChanges({pipeline: [{$changeStream: {}}], collection: 1}); diff --git a/jstests/change_streams/include_cluster_time.js b/jstests/change_streams/include_cluster_time.js index 602646faebc..387c368ecc1 100644 --- a/jstests/change_streams/include_cluster_time.js +++ b/jstests/change_streams/include_cluster_time.js @@ -2,7 +2,10 @@ (function() { "use strict"; - const coll = db.include_cluster_time; + load("jstests/libs/collection_drop_recreate.js"); // For assert[Drop|Create]Collection. + + // Drop and recreate the collections to be used in this set of tests. + const coll = assertDropAndRecreateCollection(db, "include_cluster_time"); const collectionStream = coll.watch(); const dbStream = |