summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/hooks/run_check_repl_dbhash_background.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/jstests/hooks/run_check_repl_dbhash_background.js b/jstests/hooks/run_check_repl_dbhash_background.js
index 30a7828ec28..5d7e2698780 100644
--- a/jstests/hooks/run_check_repl_dbhash_background.js
+++ b/jstests/hooks/run_check_repl_dbhash_background.js
@@ -470,10 +470,20 @@
}
} finally {
// Wait for each thread to finish. Throw an error if any thread fails.
+ let exception;
const returnData = threads.map(thread => {
- thread.join();
- return thread.returnData();
+ try {
+ thread.join();
+ return thread.returnData();
+ } catch (e) {
+ if (!exception) {
+ exception = e;
+ }
+ }
});
+ if (exception) {
+ throw exception;
+ }
returnData.forEach(res => {
assert.commandWorked(res, () => 'data consistency checks failed: ' + tojson(res));