summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/noPassthrough/dbcheck_no_history_on_secondary.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/noPassthrough/dbcheck_no_history_on_secondary.js b/jstests/noPassthrough/dbcheck_no_history_on_secondary.js
index e9bbb938235..1c94ab416eb 100644
--- a/jstests/noPassthrough/dbcheck_no_history_on_secondary.js
+++ b/jstests/noPassthrough/dbcheck_no_history_on_secondary.js
@@ -31,9 +31,11 @@ const primary = replTest.getPrimary();
const secondary = replTest.getSecondary();
const testDB = primary.getDB('test');
+let docs = [];
for (let i = 0; i < 100; i++) {
- assert.commandWorked(testDB.foo.insert({a: i}));
+ docs.push({a: i});
}
+assert.commandWorked(testDB.foo.insert(docs));
const sleepMs = 3000;
const fp = configureFailPoint(primary, 'SleepDbCheckInBatch', {sleepMs: sleepMs});
@@ -42,9 +44,11 @@ const fp = configureFailPoint(primary, 'SleepDbCheckInBatch', {sleepMs: sleepMs}
assert.commandWorked(testDB.getSiblingDB('test').runCommand({dbCheck: 1}));
// Write some data to advance the durable timestamp while we're waiting for dbCheck to run.
+docs = [];
for (let i = 0; i < 100; i++) {
- assert.commandWorked(testDB.foo.insert({_id: i}));
+ docs.push({_id: i});
}
+assert.commandWorked(testDB.foo.insert(docs));
fp.off();