Co-authored-by: Joan Bruguera Micó (MongoDB) <joan.bruguera-mico@mongodb.com> GitOrigin-RevId: 5ae5f7423024ccb70a12d4d28d31055d378696b1
52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
/**
|
|
* Tests that commands that accept write concern correctly return write concern errors when run
|
|
* through mongos on timeseries views.
|
|
*
|
|
* @tags: [
|
|
* multiversion_incompatible,
|
|
* uses_transactions,
|
|
* does_not_support_stepdowns,
|
|
* # TODO SERVER-110187 re-enable this test in viewless timeseries suites
|
|
* featureFlagCreateViewlessTimeseriesCollections_incompatible,
|
|
* ]
|
|
*/
|
|
|
|
import {ReplSetTest} from "jstests/libs/replsettest.js";
|
|
import {
|
|
checkWriteConcernBehaviorAdditionalCRUDOps,
|
|
checkWriteConcernBehaviorForAllCommands,
|
|
} from "jstests/libs/write_concern_all_commands.js";
|
|
|
|
const name = jsTestName();
|
|
const replTest = new ReplSetTest({
|
|
name: name,
|
|
nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}],
|
|
});
|
|
replTest.startSet();
|
|
replTest.initiate();
|
|
|
|
const preSetupTimeseries = function (conn, cluster, dbName, collName) {
|
|
let db = conn.getDB(dbName);
|
|
assert.commandWorked(db.createCollection(collName, {timeseries: {timeField: "time", metaField: "meta"}}));
|
|
};
|
|
|
|
checkWriteConcernBehaviorForAllCommands(
|
|
replTest.getPrimary(),
|
|
replTest,
|
|
"rs" /* clusterType */,
|
|
preSetupTimeseries,
|
|
false /* shardedCollection */,
|
|
true /*limitToTimeseriesViews*/,
|
|
);
|
|
checkWriteConcernBehaviorAdditionalCRUDOps(
|
|
replTest.getPrimary(),
|
|
replTest,
|
|
"rs" /* clusterType */,
|
|
preSetupTimeseries,
|
|
false /* shardedCollection */,
|
|
false /* writeWithoutShardKey */,
|
|
true /*limitToTimeseriesViews*/,
|
|
);
|
|
|
|
replTest.stopSet();
|