summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2023-05-22 16:29:12 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-08-21 13:41:07 +0000
commit03af141e3ba217b998079946752f1d4d0b284cf4 (patch)
treec83bc4b7c428cad2a416272b9abe53ff26158e18
parent61252ce935130f76aee2c68509b3a28c090e4361 (diff)
SERVER-77223 dbcheck_detects_data_corruption.js needs to wait for primary to log healthlog entry
(cherry picked from commit 18f5985325621c8fb2666fc3c4f3bf614bbdd6cc)
-rw-r--r--jstests/noPassthrough/dbcheck_detects_data_corruption.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/jstests/noPassthrough/dbcheck_detects_data_corruption.js b/jstests/noPassthrough/dbcheck_detects_data_corruption.js
index cb52793dc8f..616f07aae47 100644
--- a/jstests/noPassthrough/dbcheck_detects_data_corruption.js
+++ b/jstests/noPassthrough/dbcheck_detects_data_corruption.js
@@ -41,8 +41,11 @@ assert(!res.valid, res);
assert.commandWorked(db.runCommand({"dbCheck": 1}));
// Wait for both nodes to finish checking.
-const healthlogSecondary = secondary.getDB('local').system.healthlog;
-assert.soon(() => healthlogSecondary.find({operation: "dbCheckStop"}).itcount() == 1);
+[primary, secondary].forEach((node) => {
+ print("waiting for node to finish: " + tojson(node));
+ const healthlog = node.getDB('local').system.healthlog;
+ assert.soon(() => healthlog.find({operation: "dbCheckStop"}).itcount() == 1);
+});
[primary, secondary].forEach((node) => {
print("checking " + tojson(node));