diff options
-rw-r--r-- | jstests/core/stress_test_unique_index_notunique.js | 10 | ||||
-rw-r--r-- | jstests/core/stress_test_unique_index_unique.js | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/jstests/core/stress_test_unique_index_notunique.js b/jstests/core/stress_test_unique_index_notunique.js index 9817f20a2a5..f0377eaadc5 100644 --- a/jstests/core/stress_test_unique_index_notunique.js +++ b/jstests/core/stress_test_unique_index_notunique.js @@ -8,10 +8,18 @@ (function() { "use strict"; +load("jstests/concurrency/fsm_workload_helpers/server_types.js"); +// This workload would timeout on ephemeralForTest. isEphemeralForTest throws an exception if called +// from a mongos, so we need to check that first. Unique indexes are not supported on sharded +// collections anyway so it's safe to quit early if the db is a mongos. +if (isMongos(db) || isEphemeralForTest(db)) { + return; +} + let coll = db.stress_test_unique_index_notunique; coll.drop(); -const kNumDocs = 2000000; // ~65 MB +const kNumDocs = 500000; // ~15 MB function loadCollectionWithDocs(collection, numDocs) { const kMaxChunkSize = 100000; diff --git a/jstests/core/stress_test_unique_index_unique.js b/jstests/core/stress_test_unique_index_unique.js index 8f94ba55497..a83e406ed40 100644 --- a/jstests/core/stress_test_unique_index_unique.js +++ b/jstests/core/stress_test_unique_index_unique.js @@ -8,10 +8,18 @@ (function() { "use strict"; +load("jstests/concurrency/fsm_workload_helpers/server_types.js"); +// This workload would timeout on ephemeralForTest. isEphemeralForTest throws an exception if called +// from a mongos, so we need to check that first. Unique indexes are not supported on sharded +// collections anyway so it's safe to quit early if the db is a mongos. +if (isMongos(db) || isEphemeralForTest(db)) { + return; +} + let coll = db.stress_test_unique_index_unique; coll.drop(); -const kNumDocs = 2000000; // ~65 MB +const kNumDocs = 500000; // ~15 MB function loadCollectionWithDocs(collection, numDocs) { const kMaxChunkSize = 100000; |