Small fixups that fell through. See the commit messages for details.
Can be tested via:
diff --git a/src/util/thread.cpp b/src/util/thread.cpp
index 0fde73c..4fcfe4f 100644
--- a/src/util/thread.cpp
+++ b/src/util/thread.cpp
@@ -8,2 +8,3 @@
#include <util/log.h>
+#include <util/time.h>
#include <util/threadnames.h>
@@ -18,2 +19,3 @@ void util::TraceThread(std::string_view thread_name, std::function<void()> threa
util::ThreadRename(std::string{thread_name});
+ UninterruptibleSleep(999ms);
try {
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp
index c7be6ab..3237aec 100644
--- a/src/validationinterface.cpp
+++ b/src/validationinterface.cpp
@@ -14,2 +14,3 @@
#include <primitives/transaction.h>
+#include <random.h>
#include <util/check.h>
@@ -156,2 +157,4 @@ void ValidationSignals::SyncWithValidationInterfaceQueue()
+static FastRandomContext g_rnd{};
+
// Use a macro instead of a function for conditional logging to prevent
@@ -166,2 +169,3 @@ void ValidationSignals::SyncWithValidationInterfaceQueue()
LOG_EVENT(fmt, local_name, __VA_ARGS__); \
+ if(g_rnd.randrange(2)<1)UninterruptibleSleep(55ms);\
event(); \
With this diff and without the changes here, the touched tests fail. With this diff and with the changes here, the touched tests pass.