From bc2892576ac1893706bdd170daa8a02842bb355f Mon Sep 17 00:00:00 2001 From: William Schultz Date: Tue, 12 May 2020 15:52:51 -0400 Subject: SERVER-47691 Add missing explicit JS dependencies for tests that use ReplSetTest (cherry picked from commit f836e3ce66cc0051a468892763d61018004df4b0) --- jstests/noPassthrough/auto_safe_reconfig_helper_max_voting_nodes.js | 2 ++ jstests/noPassthrough/auto_safe_reconfig_helpers.js | 2 ++ jstests/noPassthrough/index_build_yield_prepare_conflicts.js | 1 + jstests/noPassthrough/index_empty_collection_secondary.js | 1 + jstests/noPassthrough/index_killop_after_stepdown.js | 1 + jstests/noPassthrough/index_stepdown_abort_prepare_conflict.js | 1 + jstests/noPassthrough/index_stepdown_commit_prepare_conflict.js | 1 + jstests/noPassthrough/index_stepdown_prepare_conflict.js | 1 + jstests/noPassthrough/kill_operations.js | 2 ++ jstests/noPassthrough/out_merge_on_secondary_metadata.js | 2 ++ .../sharded_index_consistency_metrics_stale_version_retries.js | 1 + jstests/replsets/change_sync_source_in_initial_sync.js | 2 ++ .../replsets/initial_sync_nodes_contribute_to_liveness_majorities.js | 1 + jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js | 1 + jstests/replsets/no_progress_updates_during_initial_sync.js | 1 + jstests/replsets/reconfig_avoids_diverging_configs.js | 1 + jstests/replsets/resync_majority_member.js | 1 + jstests/replsets/server_status_metrics.js | 1 + jstests/replsets/stable_timestamp_can_advance_after_oplog_hole_abort.js | 1 + jstests/sharding/cleanup_orphaned_with_resumable_range_deleter.js | 2 ++ jstests/sharding/configsvr_retries_createindex_on_stale_config.js | 1 + jstests/sharding/drop_indexes_with_stale_config_error.js | 1 + jstests/sharding/index_commands_shard_targeting.js | 1 + jstests/sharding/list_indexes_shard_targeting.js | 1 + jstests/sharding/migration_coordinator_abort_failover.js | 1 + jstests/sharding/migration_coordinator_commit_failover.js | 1 + jstests/sharding/migration_coordinator_killop_in_critical_section.js | 1 + jstests/sharding/migration_coordinator_shutdown_in_critical_section.js | 1 + jstests/sharding/migration_fails_if_exists_in_rangedeletions.js | 1 + .../sharding/mongos_not_mark_nodes_as_down_when_reads_or_pings_fail.js | 1 + jstests/sharding/primary_config_server_blackholed_from_mongos.js | 2 ++ .../sharding/range_deleter_interacts_correctly_with_refine_shard_key.js | 1 + 32 files changed, 39 insertions(+) (limited to 'jstests') diff --git a/jstests/noPassthrough/auto_safe_reconfig_helper_max_voting_nodes.js b/jstests/noPassthrough/auto_safe_reconfig_helper_max_voting_nodes.js index 92bba2fc789..1a9887e6995 100644 --- a/jstests/noPassthrough/auto_safe_reconfig_helper_max_voting_nodes.js +++ b/jstests/noPassthrough/auto_safe_reconfig_helper_max_voting_nodes.js @@ -7,6 +7,8 @@ (function() { "use strict"; +load("jstests/replsets/rslib.js"); + // Make secondaries unelectable. Add 7 voting nodes, which is the maximum allowed. const replTest = new ReplSetTest({ nodes: [ diff --git a/jstests/noPassthrough/auto_safe_reconfig_helpers.js b/jstests/noPassthrough/auto_safe_reconfig_helpers.js index fc87c512171..1846b9eab20 100644 --- a/jstests/noPassthrough/auto_safe_reconfig_helpers.js +++ b/jstests/noPassthrough/auto_safe_reconfig_helpers.js @@ -6,6 +6,8 @@ (function() { "use strict"; +load("jstests/replsets/rslib.js"); + // Make secondaries unelectable. const replTest = new ReplSetTest({nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {priority: 0}}]}); diff --git a/jstests/noPassthrough/index_build_yield_prepare_conflicts.js b/jstests/noPassthrough/index_build_yield_prepare_conflicts.js index 14c3190f114..e28fae3d36a 100644 --- a/jstests/noPassthrough/index_build_yield_prepare_conflicts.js +++ b/jstests/noPassthrough/index_build_yield_prepare_conflicts.js @@ -10,6 +10,7 @@ */ load("jstests/core/txns/libs/prepare_helpers.js"); // For PrepareHelpers. load("jstests/noPassthrough/libs/index_build.js"); // For IndexBuildTest +load("jstests/libs/fail_point_util.js"); (function() { diff --git a/jstests/noPassthrough/index_empty_collection_secondary.js b/jstests/noPassthrough/index_empty_collection_secondary.js index 5692a9175bc..6c67b7c4e03 100644 --- a/jstests/noPassthrough/index_empty_collection_secondary.js +++ b/jstests/noPassthrough/index_empty_collection_secondary.js @@ -15,6 +15,7 @@ "use strict"; load('jstests/noPassthrough/libs/index_build.js'); +load("jstests/libs/fail_point_util.js"); // Use a 3-node replica set config to ensure that the primary waits for the secondaries when the // commit quorum is in effect. diff --git a/jstests/noPassthrough/index_killop_after_stepdown.js b/jstests/noPassthrough/index_killop_after_stepdown.js index 67841202c0c..6bd990dcdb6 100644 --- a/jstests/noPassthrough/index_killop_after_stepdown.js +++ b/jstests/noPassthrough/index_killop_after_stepdown.js @@ -10,6 +10,7 @@ "use strict"; load('jstests/noPassthrough/libs/index_build.js'); +load("jstests/libs/fail_point_util.js"); const rst = new ReplSetTest({ nodes: [ diff --git a/jstests/noPassthrough/index_stepdown_abort_prepare_conflict.js b/jstests/noPassthrough/index_stepdown_abort_prepare_conflict.js index 1822a0ac421..c47922aeb68 100644 --- a/jstests/noPassthrough/index_stepdown_abort_prepare_conflict.js +++ b/jstests/noPassthrough/index_stepdown_abort_prepare_conflict.js @@ -22,6 +22,7 @@ load('jstests/noPassthrough/libs/index_build.js'); load("jstests/replsets/rslib.js"); load("jstests/core/txns/libs/prepare_helpers.js"); +load("jstests/libs/fail_point_util.js"); (function() { diff --git a/jstests/noPassthrough/index_stepdown_commit_prepare_conflict.js b/jstests/noPassthrough/index_stepdown_commit_prepare_conflict.js index 6291c5ce361..7eba3655915 100644 --- a/jstests/noPassthrough/index_stepdown_commit_prepare_conflict.js +++ b/jstests/noPassthrough/index_stepdown_commit_prepare_conflict.js @@ -22,6 +22,7 @@ load('jstests/noPassthrough/libs/index_build.js'); load("jstests/replsets/rslib.js"); load("jstests/core/txns/libs/prepare_helpers.js"); +load("jstests/libs/fail_point_util.js"); (function() { diff --git a/jstests/noPassthrough/index_stepdown_prepare_conflict.js b/jstests/noPassthrough/index_stepdown_prepare_conflict.js index 3fff120e9f9..fb4dbeeaf50 100644 --- a/jstests/noPassthrough/index_stepdown_prepare_conflict.js +++ b/jstests/noPassthrough/index_stepdown_prepare_conflict.js @@ -19,6 +19,7 @@ load('jstests/noPassthrough/libs/index_build.js'); load("jstests/replsets/rslib.js"); load("jstests/core/txns/libs/prepare_helpers.js"); +load("jstests/libs/fail_point_util.js"); (function() { diff --git a/jstests/noPassthrough/kill_operations.js b/jstests/noPassthrough/kill_operations.js index bc13e7bbe33..ccd2a4a7240 100644 --- a/jstests/noPassthrough/kill_operations.js +++ b/jstests/noPassthrough/kill_operations.js @@ -4,6 +4,8 @@ (function() { "use strict"; +load("jstests/libs/parallelTester.js"); // For Thread. + const kDbName = "kill_operations"; const kCollName = "test"; const kNumDocs = 10; diff --git a/jstests/noPassthrough/out_merge_on_secondary_metadata.js b/jstests/noPassthrough/out_merge_on_secondary_metadata.js index 6bb245bb04e..69cea1167b3 100644 --- a/jstests/noPassthrough/out_merge_on_secondary_metadata.js +++ b/jstests/noPassthrough/out_merge_on_secondary_metadata.js @@ -7,6 +7,8 @@ (function() { "use strict"; +load("jstests/libs/fail_point_util.js"); + const replTest = new ReplSetTest({nodes: 2}); replTest.startSet(); replTest.initiate(); diff --git a/jstests/noPassthrough/sharded_index_consistency_metrics_stale_version_retries.js b/jstests/noPassthrough/sharded_index_consistency_metrics_stale_version_retries.js index d005c385d25..c07642d03f1 100644 --- a/jstests/noPassthrough/sharded_index_consistency_metrics_stale_version_retries.js +++ b/jstests/noPassthrough/sharded_index_consistency_metrics_stale_version_retries.js @@ -8,6 +8,7 @@ load("jstests/noPassthrough/libs/sharded_index_consistency_metrics_helpers.js"); load("jstests/sharding/libs/shard_versioning_util.js"); +load("jstests/libs/fail_point_util.js"); // This test creates inconsistent indexes. TestData.skipCheckingIndexesConsistentAcrossCluster = true; diff --git a/jstests/replsets/change_sync_source_in_initial_sync.js b/jstests/replsets/change_sync_source_in_initial_sync.js index 0d592e42455..51ecd91d578 100644 --- a/jstests/replsets/change_sync_source_in_initial_sync.js +++ b/jstests/replsets/change_sync_source_in_initial_sync.js @@ -8,6 +8,8 @@ (function() { "use strict"; +load('jstests/libs/fail_point_util.js'); + const testName = "change_sync_source_in_initial_sync"; const dbName = testName; diff --git a/jstests/replsets/initial_sync_nodes_contribute_to_liveness_majorities.js b/jstests/replsets/initial_sync_nodes_contribute_to_liveness_majorities.js index 8f8adf71f97..a5787e445ac 100644 --- a/jstests/replsets/initial_sync_nodes_contribute_to_liveness_majorities.js +++ b/jstests/replsets/initial_sync_nodes_contribute_to_liveness_majorities.js @@ -12,6 +12,7 @@ "use strict"; load("jstests/libs/fail_point_util.js"); +load("jstests/replsets/rslib.js"); const name = jsTestName(); const rst = new ReplSetTest({ diff --git a/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js b/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js index 4f04286d0ca..249706470b1 100644 --- a/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js +++ b/jstests/replsets/initial_sync_nodes_maintain_and_gossip_commit_point.js @@ -13,6 +13,7 @@ "use strict"; load("jstests/libs/fail_point_util.js"); +load("jstests/replsets/rslib.js"); const name = jsTestName(); const rst = new ReplSetTest({ diff --git a/jstests/replsets/no_progress_updates_during_initial_sync.js b/jstests/replsets/no_progress_updates_during_initial_sync.js index 11f6b858d71..a73ee7d17ae 100644 --- a/jstests/replsets/no_progress_updates_during_initial_sync.js +++ b/jstests/replsets/no_progress_updates_during_initial_sync.js @@ -12,6 +12,7 @@ "use strict"; load("jstests/libs/write_concern_util.js"); +load("jstests/libs/fail_point_util.js"); const testName = jsTestName(); const rst = new ReplSetTest({name: testName, nodes: [{}, {rsConfig: {priority: 0}}]}); diff --git a/jstests/replsets/reconfig_avoids_diverging_configs.js b/jstests/replsets/reconfig_avoids_diverging_configs.js index 6697b0497a5..1a8a5744868 100644 --- a/jstests/replsets/reconfig_avoids_diverging_configs.js +++ b/jstests/replsets/reconfig_avoids_diverging_configs.js @@ -21,6 +21,7 @@ load("jstests/libs/parallel_shell_helpers.js"); load('jstests/libs/test_background_ops.js'); load("jstests/replsets/rslib.js"); load('jstests/aggregation/extras/utils.js'); +load("jstests/libs/fail_point_util.js"); let rst = new ReplSetTest({nodes: 4, useBridge: true}); rst.startSet(); diff --git a/jstests/replsets/resync_majority_member.js b/jstests/replsets/resync_majority_member.js index 265c03d3406..29d1e0c921e 100644 --- a/jstests/replsets/resync_majority_member.js +++ b/jstests/replsets/resync_majority_member.js @@ -12,6 +12,7 @@ "use strict"; load("jstests/libs/write_concern_util.js"); +load("jstests/libs/fail_point_util.js"); TestData.skipCheckDBHashes = true; // the set is not consistent when we shutdown the test diff --git a/jstests/replsets/server_status_metrics.js b/jstests/replsets/server_status_metrics.js index a88bb03c80d..5d0878dc519 100644 --- a/jstests/replsets/server_status_metrics.js +++ b/jstests/replsets/server_status_metrics.js @@ -12,6 +12,7 @@ "use strict"; load("jstests/libs/write_concern_util.js"); +load("jstests/libs/fail_point_util.js"); /** * Test replication metrics diff --git a/jstests/replsets/stable_timestamp_can_advance_after_oplog_hole_abort.js b/jstests/replsets/stable_timestamp_can_advance_after_oplog_hole_abort.js index 41a20e892c3..c6408e903f8 100644 --- a/jstests/replsets/stable_timestamp_can_advance_after_oplog_hole_abort.js +++ b/jstests/replsets/stable_timestamp_can_advance_after_oplog_hole_abort.js @@ -7,6 +7,7 @@ (function() { "use strict"; load("jstests/libs/fail_point_util.js"); +load("jstests/libs/parallelTester.js"); // For Thread. const replTest = new ReplSetTest({nodes: 1}); replTest.startSet(); diff --git a/jstests/sharding/cleanup_orphaned_with_resumable_range_deleter.js b/jstests/sharding/cleanup_orphaned_with_resumable_range_deleter.js index 97c8b2fe9d0..8476ea875d4 100644 --- a/jstests/sharding/cleanup_orphaned_with_resumable_range_deleter.js +++ b/jstests/sharding/cleanup_orphaned_with_resumable_range_deleter.js @@ -13,6 +13,8 @@ (function() { +load("jstests/libs/fail_point_util.js"); + const dbName = "test"; const collName = "foo"; const ns = dbName + "." + collName; diff --git a/jstests/sharding/configsvr_retries_createindex_on_stale_config.js b/jstests/sharding/configsvr_retries_createindex_on_stale_config.js index b8d98b4a142..895344506f6 100644 --- a/jstests/sharding/configsvr_retries_createindex_on_stale_config.js +++ b/jstests/sharding/configsvr_retries_createindex_on_stale_config.js @@ -7,6 +7,7 @@ load('jstests/libs/sessions_collection.js'); load("jstests/sharding/libs/shard_versioning_util.js"); +load("jstests/libs/fail_point_util.js"); let st = new ShardingTest({shards: 2}); diff --git a/jstests/sharding/drop_indexes_with_stale_config_error.js b/jstests/sharding/drop_indexes_with_stale_config_error.js index e523ab9533e..7a6a1a32b52 100644 --- a/jstests/sharding/drop_indexes_with_stale_config_error.js +++ b/jstests/sharding/drop_indexes_with_stale_config_error.js @@ -10,6 +10,7 @@ load("jstests/sharding/libs/shard_versioning_util.js"); load('jstests/sharding/libs/sharded_transactions_helpers.js'); +load("jstests/libs/fail_point_util.js"); const st = new ShardingTest({mongos: 2, shards: 2}); const dbName = jsTestName(); diff --git a/jstests/sharding/index_commands_shard_targeting.js b/jstests/sharding/index_commands_shard_targeting.js index 9f46af4d46e..6c32b5b0bf0 100644 --- a/jstests/sharding/index_commands_shard_targeting.js +++ b/jstests/sharding/index_commands_shard_targeting.js @@ -11,6 +11,7 @@ load('jstests/libs/chunk_manipulation_util.js'); load("jstests/libs/fail_point_util.js"); load("jstests/sharding/libs/sharded_index_util.js"); load("jstests/sharding/libs/shard_versioning_util.js"); +load("jstests/libs/parallelTester.js"); // For Thread. // Test deliberately inserts orphans outside of migration. TestData.skipCheckOrphans = true; diff --git a/jstests/sharding/list_indexes_shard_targeting.js b/jstests/sharding/list_indexes_shard_targeting.js index 8ab2f47c4b4..7021a948088 100644 --- a/jstests/sharding/list_indexes_shard_targeting.js +++ b/jstests/sharding/list_indexes_shard_targeting.js @@ -8,6 +8,7 @@ "use strict"; load("jstests/sharding/libs/shard_versioning_util.js"); +load("jstests/libs/fail_point_util.js"); // This test makes shards have inconsistent indexes. TestData.skipCheckingIndexesConsistentAcrossCluster = true; diff --git a/jstests/sharding/migration_coordinator_abort_failover.js b/jstests/sharding/migration_coordinator_abort_failover.js index 8aefde287c5..a513e343997 100644 --- a/jstests/sharding/migration_coordinator_abort_failover.js +++ b/jstests/sharding/migration_coordinator_abort_failover.js @@ -12,6 +12,7 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true; 'use strict'; load('jstests/sharding/migration_coordinator_failover_include.js'); +load('jstests/replsets/rslib.js'); const dbName = "test"; diff --git a/jstests/sharding/migration_coordinator_commit_failover.js b/jstests/sharding/migration_coordinator_commit_failover.js index b3757f43498..c18fdfc6447 100644 --- a/jstests/sharding/migration_coordinator_commit_failover.js +++ b/jstests/sharding/migration_coordinator_commit_failover.js @@ -12,6 +12,7 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true; 'use strict'; load('jstests/sharding/migration_coordinator_failover_include.js'); +load('jstests/replsets/rslib.js'); const dbName = "test"; diff --git a/jstests/sharding/migration_coordinator_killop_in_critical_section.js b/jstests/sharding/migration_coordinator_killop_in_critical_section.js index d70e698d5fb..4ed5a03e924 100644 --- a/jstests/sharding/migration_coordinator_killop_in_critical_section.js +++ b/jstests/sharding/migration_coordinator_killop_in_critical_section.js @@ -14,6 +14,7 @@ 'use strict'; load('jstests/libs/parallel_shell_helpers.js'); +load('jstests/libs/fail_point_util.js'); function getNewNs(dbName) { if (typeof getNewNs.counter == 'undefined') { diff --git a/jstests/sharding/migration_coordinator_shutdown_in_critical_section.js b/jstests/sharding/migration_coordinator_shutdown_in_critical_section.js index 51914a4fea6..1a151a596cb 100644 --- a/jstests/sharding/migration_coordinator_shutdown_in_critical_section.js +++ b/jstests/sharding/migration_coordinator_shutdown_in_critical_section.js @@ -17,6 +17,7 @@ TestData.skipCheckingIndexesConsistentAcrossCluster = true; TestData.skipCheckOrphans = true; load('jstests/libs/parallel_shell_helpers.js'); +load('jstests/libs/fail_point_util.js'); function getNewNs(dbName) { if (typeof getNewNs.counter == 'undefined') { diff --git a/jstests/sharding/migration_fails_if_exists_in_rangedeletions.js b/jstests/sharding/migration_fails_if_exists_in_rangedeletions.js index 5c8cdd44bdc..94a80df1f20 100644 --- a/jstests/sharding/migration_fails_if_exists_in_rangedeletions.js +++ b/jstests/sharding/migration_fails_if_exists_in_rangedeletions.js @@ -7,6 +7,7 @@ "use strict"; load("jstests/libs/uuid_util.js"); +load("jstests/libs/fail_point_util.js"); const dbName = "test"; const collName = "foo"; diff --git a/jstests/sharding/mongos_not_mark_nodes_as_down_when_reads_or_pings_fail.js b/jstests/sharding/mongos_not_mark_nodes_as_down_when_reads_or_pings_fail.js index c526e110eff..e426b8ea204 100644 --- a/jstests/sharding/mongos_not_mark_nodes_as_down_when_reads_or_pings_fail.js +++ b/jstests/sharding/mongos_not_mark_nodes_as_down_when_reads_or_pings_fail.js @@ -6,6 +6,7 @@ 'use strict'; load("jstests/libs/fail_point_util.js"); +load("jstests/replsets/rslib.js"); /* * Configures failCommand to force the given command to fail with the given error code when run diff --git a/jstests/sharding/primary_config_server_blackholed_from_mongos.js b/jstests/sharding/primary_config_server_blackholed_from_mongos.js index c13d6c12b8a..22a4f4502cf 100644 --- a/jstests/sharding/primary_config_server_blackholed_from_mongos.js +++ b/jstests/sharding/primary_config_server_blackholed_from_mongos.js @@ -3,6 +3,8 @@ (function() { 'use strict'; +load('jstests/replsets/rslib.js'); + // Checking index consistency involves talking to the primary config server which is blackholed from // the mongos in this test. TestData.skipCheckingIndexesConsistentAcrossCluster = true; diff --git a/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js b/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js index 5c3c22a52c9..d5139a88ce2 100644 --- a/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js +++ b/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js @@ -9,6 +9,7 @@ load("jstests/libs/fail_point_util.js"); load('jstests/libs/parallel_shell_helpers.js'); +load('jstests/replsets/rslib.js'); TestData.skipCheckingUUIDsConsistentAcrossCluster = true; -- cgit v1.2.1