diff options
author | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2020-09-08 11:02:18 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-08 16:06:01 +0000 |
commit | ec0866979a0749f6ee3a97b9932f73e6e21bf165 (patch) | |
tree | 5b994acc8fa2c43d99329e8b92892590a419008d | |
parent | 56de72881f50d709b5898c567f646097f7af2694 (diff) | |
download | mongo-ec0866979a0749f6ee3a97b9932f73e6e21bf165.tar.gz |
SERVER-50784 Restore cluster settings after all JS test fuzzer suites
13 files changed, 17 insertions, 13 deletions
diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz.yml b/buildscripts/resmokeconfig/suites/jstestfuzz.yml index 7b618418a08..b90c1c772c1 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz.yml @@ -12,6 +12,7 @@ executor: shell_options: readMode: commands hooks: + - class: FuzzerRestoreSettings - class: ValidateCollections shell_options: global_vars: diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt.yml index 68e272fd1cf..6d19ad4f8da 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt.yml @@ -16,6 +16,7 @@ executor: eval: load('jstests/libs/jstestfuzz/check_for_interrupt_hook.js') readMode: commands hooks: + - class: FuzzerRestoreSettings - class: ValidateCollections shell_options: global_vars: diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt_replication.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt_replication.yml index 6e3fb1b8473..cb1d457a38f 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt_replication.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_interrupt_replication.yml @@ -18,7 +18,7 @@ executor: eval: load('jstests/libs/jstestfuzz/check_for_interrupt_hook.js') readMode: commands hooks: - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings # 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. diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_replication.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_replication.yml index 00222a77e50..9a5162ad28b 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_replication.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_replication.yml @@ -18,7 +18,7 @@ executor: # Other fuzzers test commands against replica sets with logical session ids. disableImplicitSessions: true hooks: - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings # 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. diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_replication_continuous_stepdown.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_replication_continuous_stepdown.yml index 2fac9a8ea10..41cac64ae75 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_replication_continuous_stepdown.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_replication_continuous_stepdown.yml @@ -17,7 +17,7 @@ executor: ignoreCommandsIncompatibleWithRollback: true hooks: - class: ContinuousStepdown - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings # 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. diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_replication_initsync.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_replication_initsync.yml index 9b44c4c1433..710af8bb12d 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_replication_initsync.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_replication_initsync.yml @@ -21,6 +21,7 @@ executor: global_vars: TestData: skipValidationOnInvalidViewDefinitions: true + - class: FuzzerRestoreSettings fixture: class: ReplicaSetFixture mongod_options: diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_replication_session.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_replication_session.yml index cf7231906f7..e2e49418bde 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_replication_session.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_replication_session.yml @@ -15,7 +15,7 @@ executor: eval: load("jstests/libs/override_methods/enable_sessions.js") readMode: commands hooks: - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings # 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. diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded.yml index 0ab4cc112d2..d1c96f2d83e 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded.yml @@ -17,7 +17,7 @@ executor: disableImplicitSessions: true readMode: commands hooks: - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings - class: CheckReplDBHash shell_options: global_vars: diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_causal_consistency.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_causal_consistency.yml index 47535eff531..99c20d44dec 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_causal_consistency.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_causal_consistency.yml @@ -18,7 +18,7 @@ executor: runningWithCausalConsistency: true usingReplicaSetShards: true hooks: - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings - class: CheckReplDBHash shell_options: global_vars: diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_continuous_stepdown.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_continuous_stepdown.yml index 69d42ca41bb..048550e60aa 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_continuous_stepdown.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_continuous_stepdown.yml @@ -21,7 +21,7 @@ executor: - class: ContinuousStepdown config_stepdown: true shard_stepdown: true - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings # 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. diff --git a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_session.yml b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_session.yml index 6b556fb29b4..cdf01064dc5 100644 --- a/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_session.yml +++ b/buildscripts/resmokeconfig/suites/jstestfuzz_sharded_session.yml @@ -14,7 +14,7 @@ executor: eval: load("jstests/libs/override_methods/enable_sessions.js") readMode: commands hooks: - - class: FuzzerRestoreClusterSettings + - class: FuzzerRestoreSettings - class: CheckReplDBHash shell_options: global_vars: diff --git a/buildscripts/resmokelib/testing/hooks/fuzzer_restore_cluster_settings.py b/buildscripts/resmokelib/testing/hooks/fuzzer_restore_settings.py index f1432a437df..c559819accd 100644 --- a/buildscripts/resmokelib/testing/hooks/fuzzer_restore_cluster_settings.py +++ b/buildscripts/resmokelib/testing/hooks/fuzzer_restore_settings.py @@ -9,12 +9,12 @@ import os.path from buildscripts.resmokelib.testing.hooks import jsfile -class FuzzerRestoreClusterSettings(jsfile.JSHook): +class FuzzerRestoreSettings(jsfile.JSHook): """Cleans up unwanted changes from fuzzer.""" def __init__(self, hook_logger, fixture, shell_options=None): """Run fuzzer cleanup.""" description = "Clean up unwanted changes from fuzzer" - js_filename = os.path.join("jstests", "hooks", "run_fuzzer_restore_cluster_settings.js") + js_filename = os.path.join("jstests", "hooks", "run_fuzzer_restore_settings.js") jsfile.JSHook.__init__(self, hook_logger, fixture, js_filename, description, shell_options=shell_options) diff --git a/jstests/hooks/run_fuzzer_restore_cluster_settings.js b/jstests/hooks/run_fuzzer_restore_settings.js index 0b514a92e54..a2858f4e915 100644 --- a/jstests/hooks/run_fuzzer_restore_cluster_settings.js +++ b/jstests/hooks/run_fuzzer_restore_settings.js @@ -4,11 +4,12 @@ assert.commandWorked(db.adminCommand({setParameter: 1, requireApiVersion: false, apiVersion: "1"})); // Unsetting read/write settings. This command will also cause the server to refresh and get -// the new settings. -assert.commandWorked(db.adminCommand({ +// the new settings. A standalone or mongos will return an error; ignore it. +const result = db.adminCommand({ setDefaultRWConcern: 1, defaultReadConcern: {}, defaultWriteConcern: {}, writeConcern: {w: 1} -})); +}); +assert.commandWorkedOrFailedWithCode(result, [51300, 51301]); })(); |