From dfc74795b2ddd2ea75b94f5845fef965b5e5f005 Mon Sep 17 00:00:00 2001 From: Jason Chan Date: Fri, 20 Nov 2020 20:35:19 +0000 Subject: SERVER-52983 Assertions in initial_sync_replSetGetStatus.js have to account for batch sizes smaller than collectionClonerBatchSize --- jstests/replsets/initial_sync_replSetGetStatus.js | 7 +++++-- 1 file 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 = -- cgit v1.2.1