Skip to content

Commit 680082a

Browse files
committed
[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.
1 parent 939fa1b commit 680082a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lldb/source/Utility/ReproducerInstrumentation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "lldb/Utility/ReproducerInstrumentation.h"
1010
#include "lldb/Utility/Reproducer.h"
11+
#include <thread>
1112
#include <stdio.h>
1213
#include <stdlib.h>
1314

@@ -94,6 +95,10 @@ bool Registry::Replay(llvm::StringRef buffer) {
9495
GetReplayer(id)->operator()(deserializer);
9596
}
9697

98+
// Add a small artificial delay to ensure that all asynchronous events have
99+
// completed before we exit.
100+
std::this_thread::sleep_for (std::chrono::milliseconds(100));
101+
97102
return true;
98103
}
99104

0 commit comments

Comments
 (0)