[Lldb-commits] [lldb] [lldb] Don't exit the main loop when in runs out of things to listen on (PR #112565)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 17 07:41:35 PDT 2024
================
@@ -212,15 +209,14 @@ TEST_F(MainLoopTest, PendingCallbackTrigger) {
ASSERT_TRUE(callback2_called);
}
-// Regression test for assertion failure if a lot of callbacks end up
-// being queued after loop exits.
-TEST_F(MainLoopTest, PendingCallbackAfterLoopExited) {
+TEST_F(MainLoopTest, ManyPendingCallbacks) {
MainLoop loop;
Status error;
- ASSERT_TRUE(loop.Run().Success());
- // Try to fill the pipe buffer in.
+ // Try to fill up the pipe buffer and make sure bad things don't happen.
----------------
labath wrote:
I'll expand on that a bit. I had to refactor the test as it was no longer possible to run in in this way. Although it was testing very a specific scenario (adding callbacks after the loop has exited, the overall problem was wider). The original implementation was writing one character to the pipe for each interrupt/callback, which meant that you could fill up the pipe (and block) if noone was draining it. That could happen because the loop was busy doing something, not just because it has exited.
https://github.com/llvm/llvm-project/pull/112565
More information about the lldb-commits
mailing list