summaryrefslogtreecommitdiff
path: root/jstests/sharding
diff options
context:
space:
mode:
authorPaolo Polato <paolo.polato@mongodb.com>2021-07-07 10:28:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-09 08:00:14 +0000
commita8cf4f32d5b53291add8b19d6f26ccac82c50dde (patch)
tree499356c7977188928eac78a97682b9aadd86bb44 /jstests/sharding
parent33aaa656979089a8d6530d1ae3ff15335b13508a (diff)
downloadmongo-a8cf4f32d5b53291add8b19d6f26ccac82c50dde.tar.gz
SERVER-58191 Allow delete_during_migrate test to tolerate chunk migration timeouts in slow variants.
Diffstat (limited to 'jstests/sharding')
-rw-r--r--jstests/sharding/delete_during_migrate.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/jstests/sharding/delete_during_migrate.js b/jstests/sharding/delete_during_migrate.js
index 3477f57bc85..3d4d5432c0c 100644
--- a/jstests/sharding/delete_during_migrate.js
+++ b/jstests/sharding/delete_during_migrate.js
@@ -10,6 +10,10 @@
(function() {
'use strict';
+const isCodeCoverageEnabled = buildInfo().buildEnvironment.ccflags.includes('-ftest-coverage');
+const isSanitizerEnabled = buildInfo().buildEnvironment.ccflags.includes('-fsanitize');
+const slowTestVariant = isCodeCoverageEnabled || isSanitizerEnabled;
+
var st = new ShardingTest({shards: 2, mongos: 1});
var dbname = "test";
@@ -36,8 +40,15 @@ assert.commandWorked(st.s0.adminCommand({shardcollection: ns, key: {a: 1}}));
var join = startParallelShell("db." + coll + ".remove({});", st.s0.port);
// migrate while deletions are happening
-assert.commandWorked(st.s0.adminCommand(
- {moveChunk: ns, find: {a: 1}, to: st.getOther(st.getPrimaryShard(dbname)).name}));
+try {
+ assert.commandWorked(st.s0.adminCommand(
+ {moveChunk: ns, find: {a: 1}, to: st.getOther(st.getPrimaryShard(dbname)).name}));
+} catch (e) {
+ const expectedFailureMessage = "startCommit timed out waiting for the catch up completion.";
+ if (!slowTestVariant || !e.message.match(expectedFailureMessage)) {
+ throw e;
+ }
+}
join();