From: Jonas Devlieghere Date: Thu, 9 Apr 2020 18:01:33 +0000 (-0700) Subject: [lldb/Reproducers] Add a small artificial delay before exiting X-Git-Tag: llvmorg-12-init~9519 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=680082a408dd2df7410d77696100eac8ce9d5530;p=platform%2Fupstream%2Fllvm.git [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. --- 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; }