From 0ec70f6ac70716d9296a014d52e4cc99bf4e5695 Mon Sep 17 00:00:00 2001 From: XueruiFa Date: Tue, 25 May 2021 19:08:43 +0000 Subject: SERVER-55891: Create sharding API version passthrough suite --- .../sharding_api_version_jscore_passthrough.yml | 110 +++++++++++++++++++++ etc/evergreen.yml | 13 +++ 2 files changed, 123 insertions(+) create mode 100644 buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml diff --git a/buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml new file mode 100644 index 00000000000..bcfaf6b37e5 --- /dev/null +++ b/buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml @@ -0,0 +1,110 @@ +# This suite starts a cluster with two shards and runs JS core tests with the 'apiVersion' +# parameter passed in for every command. +test_kind: js_test + +selector: + roots: + - jstests/core/**/*.js + + exclude_files: + # This test initiates a txn with API parameters, but runs txn-continuing commands in a separate + # Thread object. Since those commands will not have API parameters appended, they will fail due + # to not matching the API parameters of the txn-initiating command. + - jstests/core/txns/kill_op_on_txn_expiry.js + + # + # Taken from sharding_jscore_passthrough.yml. + # + + # The following tests fail because a certain command or functionality is not supported on + # mongos. This command or functionality is placed in a comment next to the failing test. + - jstests/core/apitest_db.js # serverStatus output doesn't have storageEngine. + - jstests/core/check_shard_index.js # checkShardingIndex. + - jstests/core/collection_truncate.js # emptycapped. + - jstests/core/compact_keeps_indexes.js # compact. + - jstests/core/currentop.js # uses fsync. + - jstests/core/dbhash.js # dbhash. + - jstests/core/dbhash2.js # dbhash. + - jstests/core/dropdb_race.js # syncdelay. + - jstests/core/fsync.js # uses fsync. + - jstests/core/geo_s2cursorlimitskip.js # profiling. + - jstests/core/geo_update_btree2.js # notablescan. + - jstests/core/index9.js # "local" database. + - jstests/core/queryoptimizera.js # "local" database. + - jstests/core/stages*.js # stageDebug. + - jstests/core/startup_log.js # "local" database. + - jstests/core/top.js # top. + # The following tests fail because mongos behaves differently from mongod when testing certain + # functionality. The differences are in a comment next to the failing test. + - jstests/core/explain_missing_database.js # Behavior with no db different on mongos. + - jstests/core/geo_2d_explain.js # executionSuccess in different spot in explain(). + - jstests/core/geo_s2explain.js # inputStage in different spot in explain(). + - jstests/core/geo_s2sparse.js # keysPerIndex in different spot in validate(). + - jstests/core/operation_latency_histogram.js # Stats are counted differently on mongos, SERVER-24880. + - jstests/core/killop_drop_collection.js # Uses fsyncLock. + - jstests/core/or_to_in.js # queryPlanner in different spot in explain() + # The following tests fail because of divergent dropCollection behavior between standalones and + # sharded clusters. These tests expect a second drop command to error, whereas in sharded clusters + # we expect a second drop to return status OK. + - jstests/core/explain_upsert.js + + # transactionLifetimeLimitSeconds parameter is not available in mongos. + - jstests/core/txns/abort_expired_transaction.js + - jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js + - jstests/core/txns/kill_op_on_txn_expiry.js + + # Uses hangAfterCollectionInserts failpoint not available on mongos. + - jstests/core/txns/speculative_snapshot_includes_all_writes.js + + # Profile can only be run against the admin database on mongos. + - jstests/core/txns/transactions_profiling.js + - jstests/core/txns/transactions_profiling_with_drops.js + + # Implicitly creates a database through a collection rename, which does not work in a sharded + # cluster. + - jstests/core/txns/transactions_block_ddl.js + + exclude_with_any_tags: + - assumes_standalone_mongod + - assumes_against_mongod_not_mongos + # system.profile collection doesn't exist on mongos. + - requires_profiling + # Transactions are not allowed to operate on capped collections. + - requires_capped + # Prepare is not a command on mongos. + - uses_prepare_transaction + # These tests already pass in API parameters, so we avoid overwriting them. + - uses_api_parameters + +executor: + archive: + hooks: + - CheckReplOplogs + - CheckReplDBHash + - ValidateCollections + config: + shell_options: + eval: >- + testingReplication = true; + load('jstests/libs/override_methods/set_api_version.js'); + readMode: commands + hooks: + # The CheckReplDBHash hook waits until all operations have replicated to and have been applied + # on the secondaries, so we run the ValidateCollections hook after it to ensure we're + # validating the entire contents of the collection. + - class: CheckReplOplogs + - class: CheckReplDBHash + - class: ValidateCollections + - class: CleanEveryN + n: 20 + fixture: + class: ShardedClusterFixture + mongos_options: + set_parameters: + enableTestCommands: 1 + mongod_options: + set_parameters: + enableTestCommands: 1 + num_rs_nodes_per_shard: 2 + enable_sharding: + - test diff --git a/etc/evergreen.yml b/etc/evergreen.yml index 1e353c2787a..17d870afd33 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -4934,6 +4934,15 @@ tasks: resmoke_args: --storageEngine=wiredTiger task_path_suffix: /data/multiversion +- name: sharding_api_version_jscore_passthrough_gen + tags: ["sharding", "jscore"] + commands: + - func: "generate resmoke tasks" + vars: + depends_on: jsCore + resmoke_args: --storageEngine=wiredTiger + fallback_num_sub_suites: 5 + - <<: *task_template name: sharding_jscore_op_query_passthrough tags: ["sharding", "jscore"] @@ -8882,6 +8891,7 @@ buildvariants: - name: search_ssl - name: session_jscore_passthrough - name: .sharding .jscore !.wo_snapshot !.multi_stmt + - name: sharding_api_version_jscore_passthrough_gen - name: .sharding .txns - name: .sharding .common - name: snmp @@ -9010,6 +9020,7 @@ buildvariants: - name: search_ssl - name: session_jscore_passthrough - name: .sharding .jscore !.wo_snapshot !.multi_stmt + - name: sharding_api_version_jscore_passthrough_gen - name: .sharding .txns - name: .sharding .common - name: snmp @@ -9125,6 +9136,7 @@ buildvariants: - name: search_ssl - name: session_jscore_passthrough - name: .sharding .jscore !.wo_snapshot !.multi_stmt + - name: sharding_api_version_jscore_passthrough_gen - name: .sharding .txns - name: .sharding .common - name: sharded_multi_stmt_txn_jscore_passthrough @@ -9213,6 +9225,7 @@ buildvariants: - name: sharding_ese_gen - name: sharding_gen - name: sharding_jscore_passthrough + - name: sharding_api_version_jscore_passthrough_gen - name: sharding_jscore_passthrough_wire_ops_gen - name: sharding_jscore_op_query_passthrough - name: sharding_update_v1_oplog_jscore_passthrough -- cgit v1.2.1