diff options
| author | Gil Alon <gil.alon@mongodb.com> | 2023-09-26 21:07:49 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-09-26 21:48:38 +0000 |
| commit | 7bff196d50a937677dc800e0b08d5b9a6cc4d3b6 (patch) | |
| tree | 5716856e6ecebbf93d4f35ee84f6fea3f20e5b51 | |
| parent | aae297113407b219885bfe44f25a1fb377e04557 (diff) | |
SERVER-80964 [v7.1] Delete $out to timeseries multiversion test due to 7.0 backportr7.1.0-rc4
| -rw-r--r-- | jstests/multiVersion/targetedTestsLastLtsFeatures/timeseries_out_error.js | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/jstests/multiVersion/targetedTestsLastLtsFeatures/timeseries_out_error.js b/jstests/multiVersion/targetedTestsLastLtsFeatures/timeseries_out_error.js deleted file mode 100644 index 9fa8830074d..00000000000 --- a/jstests/multiVersion/targetedTestsLastLtsFeatures/timeseries_out_error.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Tests that $out errors when trying to write to time-series collections on older server versions. - * $out with the 'timeseries' option should only succeed if the FCV >= 7.1. - */ -import "jstests/multiVersion/libs/multi_cluster.js"; -import {awaitRSClientHosts} from "jstests/replsets/rslib.js"; - -const st = new ShardingTest({ - shards: 2, - rs: {nodes: 2}, - mongos: 1, - other: { - mongosOptions: {binVersion: "last-lts"}, - configOptions: {binVersion: "last-lts"}, - shardOptions: {binVersion: "last-lts"}, - rsOptions: {binVersion: "last-lts"} - } -}); -st.configRS.awaitReplication(); - -const dbName = "test"; -const testDB = st.s.getDB(dbName); -let coll = testDB["coll"]; -let tColl = testDB["timeseries"]; -coll.drop(); -tColl.drop(); - -// set up a source collection and a time-series target collection. -assert.commandWorked( - testDB.adminCommand({setFeatureCompatibilityVersion: lastLTSFCV, confirm: true})); -assert.commandWorked(coll.insert({t: ISODate(), m: 1})); -assert.commandWorked(testDB.createCollection(tColl.getName(), {timeseries: {timeField: "t"}})); -assert.commandWorked(tColl.insert({t: ISODate(), m: 1})); - -// assert aggregate succeeds with no 'timeseries' option. -let pipeline = [{$out: "out"}]; -assert.doesNotThrow(() => coll.aggregate(pipeline)); -assert.eq(1, testDB["out"].find().itcount()); - -// assert aggregate fails with the original error with the 'timeseries' option. -pipeline = [{$out: {coll: "out_time", db: dbName, timeseries: {timeField: "t"}}}]; -assert.throwsWithCode(() => coll.aggregate(pipeline), 16994); - -// assert aggregate fails if trying to write to a time-series collection without the 'timeseries' -// option. -let replacePipeline = [{$out: tColl.getName()}]; -assert.throwsWithCode(() => coll.aggregate(replacePipeline), ErrorCodes.InvalidOptions); - -// upgrade the shards. -jsTestLog('upgrading the shards.'); -st.upgradeCluster("latest", {upgradeMongos: false, upgradeConfigs: false}); -awaitRSClientHosts(st.s, st.rs0.getPrimary(), {ok: true, ismaster: true}); -// assert aggregate fails with the original error with the 'timeseries' option. -assert.throwsWithCode(() => coll.aggregate(pipeline), 16994); -// assert aggregate fails if trying to write to a time-series collection without the 'timeseries' -// option. -assert.throwsWithCode(() => coll.aggregate(replacePipeline), 7406100); - -// upgrade the config server and mongos. -jsTestLog('upgrading the config server and mongos.'); -st.upgradeCluster("latest", {upgradeShards: false, upgradeMongos: true, upgradeConfigs: true}); -let mongosConn = st.s; -coll = mongosConn.getDB(dbName)["coll"]; -// assert aggregate fails with an updated error with the 'timeseries' option. -assert.throwsWithCode(() => coll.aggregate(pipeline), 7406100); // new error code. -// assert aggregate fails if trying to write to a time-series collection without the 'timeseries' -// option. -assert.throwsWithCode(() => coll.aggregate(replacePipeline), 7406100); - -// upgrade the FCV version -jsTestLog('upgrading the FCV version.'); -assert.commandWorked( - mongosConn.adminCommand({setFeatureCompatibilityVersion: latestFCV, confirm: true})); -// assert aggregate with 'timeseries' succeeds. -assert.doesNotThrow(() => coll.aggregate(pipeline)); -let resultColl = mongosConn.getDB(dbName)["out_time"]; -assert.eq(1, resultColl.find().itcount()); - -// assert aggregate replacing a time-series collection without 'timeseries' succeeds. -assert.doesNotThrow(() => coll.aggregate(replacePipeline)); -resultColl = mongosConn.getDB(dbName)["timeseries"]; -assert.eq(1, resultColl.find().itcount()); - -st.stop(); |
