summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chan <jason.chan@mongodb.com>2020-11-20 20:35:19 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-21 01:06:39 +0000
commitdfc74795b2ddd2ea75b94f5845fef965b5e5f005 (patch)
tree2adf5b876dfcdeadcf6a8adb551e500eac74347c
parent943845d1ea81f8f99620af5aa96737bbaae37b5d (diff)
downloadmongo-dfc74795b2ddd2ea75b94f5845fef965b5e5f005.tar.gz
SERVER-52983 Assertions in initial_sync_replSetGetStatus.js have to account for batch sizes smaller than collectionClonerBatchSize
-rw-r--r--jstests/replsets/initial_sync_replSetGetStatus.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/jstests/replsets/initial_sync_replSetGetStatus.js b/jstests/replsets/initial_sync_replSetGetStatus.js
index d612504311b..64958be9dd7 100644
--- a/jstests/replsets/initial_sync_replSetGetStatus.js
+++ b/jstests/replsets/initial_sync_replSetGetStatus.js
@@ -76,10 +76,13 @@ assert.eq(pretestDbRes.initialSyncStatus.databases.pretest.clonedCollections, 0)
let barCollRes = pretestDbRes.initialSyncStatus.databases.pretest["pretest.bar"];
assert.eq(barCollRes.documentsToCopy, 3);
-assert.gte(barCollRes.documentsCopied, 2);
+// Even though we set the collectionClonerBatchSize to 2, it is possible for a batch to actually
+// return only 1 document. This can lead to us hitting the failpoint in the next batch instead,
+// causing us to copy up to 3 documents.
+assert.lte(barCollRes.documentsCopied, 3);
assert.gt(barCollRes.bytesToCopy, 0);
assert.gt(barCollRes.approxBytesCopied, 0);
-assert.lt(barCollRes.approxBytesCopied, barCollRes.bytesToCopy);
+assert.lte(barCollRes.approxBytesCopied, barCollRes.bytesToCopy);
assert.lt(barCollRes.approxBytesCopied, pretestDbRes.initialSyncStatus.approxTotalDataSize);
const bytesCopiedAdminDb =