summaryrefslogtreecommitdiff
path: root/jstests/hooks/run_dbcheck_background.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/hooks/run_dbcheck_background.js')
-rw-r--r--jstests/hooks/run_dbcheck_background.js34
1 files changed, 9 insertions, 25 deletions
diff --git a/jstests/hooks/run_dbcheck_background.js b/jstests/hooks/run_dbcheck_background.js
index bb4a67d85af..9a62ad58dd3 100644
--- a/jstests/hooks/run_dbcheck_background.js
+++ b/jstests/hooks/run_dbcheck_background.js
@@ -97,32 +97,16 @@ const exceptionFilteredBackgroundDbCheck = function(hosts) {
const healthlog = node.getDB('local').system.healthlog;
// Regex matching strings that start without "SnapshotTooOld"
const regexStringWithoutSnapTooOld = /^((?!^SnapshotTooOld).)*$/;
-
- // healthlog is a capped collection, truncation during scan might cause cursor
- // invalidation. Truncated data is most likely from previous tests in the fixture, so we
- // should still be able to catch errors by retrying.
- assert.soon(() => {
- try {
- let errs = healthlog.find(
- {"severity": "error", "data.error": regexStringWithoutSnapTooOld});
- if (errs.hasNext()) {
- const err = "dbCheck found inconsistency on " + node.host;
- jsTestLog(err + ". Errors: ");
- for (let count = 0; errs.hasNext() && count < 20; count++) {
- jsTestLog(tojson(errs.next()));
- }
- assert(false, err);
- }
- return true;
- } catch (e) {
- if (e.code !== ErrorCodes.CappedPositionLost) {
- throw e;
- }
- jsTestLog(`Retrying on CappedPositionLost error: ${tojson(e)}`);
- return false;
+ let errs =
+ healthlog.find({"severity": "error", "data.error": regexStringWithoutSnapTooOld});
+ if (errs.hasNext()) {
+ const err = "dbCheck found inconsistency on " + node.host;
+ jsTestLog(err + ". Errors: ");
+ for (let count = 0; errs.hasNext() && count < 20; count++) {
+ jsTestLog(tojson(errs.next()));
}
- }, "healthlog scan could not complete.", 60000);
-
+ assert(false, err);
+ }
jsTestLog("Checked health log on " + node.host);
});