From d64ba81105b86cddf7fd265573fc92955b80506f Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 29 Jul 2025 08:25:07 +0700 Subject: [PATCH] fix(tests): allow multi threaded writes to suite log --- src/test/unit_test/SuiteJournal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/unit_test/SuiteJournal.h b/src/test/unit_test/SuiteJournal.h index 0e80e83cd..cad3c574e 100644 --- a/src/test/unit_test/SuiteJournal.h +++ b/src/test/unit_test/SuiteJournal.h @@ -19,9 +19,9 @@ #ifndef TEST_UNIT_TEST_SUITE_JOURNAL_H #define TEST_UNIT_TEST_SUITE_JOURNAL_H - #include #include +#include namespace ripple { namespace test { @@ -82,7 +82,11 @@ SuiteJournalSink::write( // Only write the string if the level at least equals the threshold. if (level >= threshold()) + { + static std::mutex log_mutex; + std::lock_guard lock(log_mutex); suite_.log << s << partition_ << text << std::endl; + } } class SuiteJournal