From 680082a408dd2df7410d77696100eac8ce9d5530 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Thu, 9 Apr 2020 11:01:33 -0700 Subject: [PATCH] [lldb/Reproducers] Add a small artificial delay before exiting Add a small artificial delay in replay mode before exiting to ensure that all asynchronous events have completed. This should reduce the level of replay flakiness on some of the slower bots. --- lldb/source/Utility/ReproducerInstrumentation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lldb/source/Utility/ReproducerInstrumentation.cpp b/lldb/source/Utility/ReproducerInstrumentation.cpp index 4c32d94..3bf8128 100644 --- a/lldb/source/Utility/ReproducerInstrumentation.cpp +++ b/lldb/source/Utility/ReproducerInstrumentation.cpp @@ -8,6 +8,7 @@ #include "lldb/Utility/ReproducerInstrumentation.h" #include "lldb/Utility/Reproducer.h" +#include #include #include @@ -94,6 +95,10 @@ bool Registry::Replay(llvm::StringRef buffer) { GetReplayer(id)->operator()(deserializer); } + // Add a small artificial delay to ensure that all asynchronous events have + // completed before we exit. + std::this_thread::sleep_for (std::chrono::milliseconds(100)); + return true; } -- 2.7.4