[Lldb-commits] [lldb] [lldb][test] Speed up ProcessAttach test (PR #201530)

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 4 01:48:51 PDT 2026


https://github.com/Teemperor created https://github.com/llvm/llvm-project/pull/201530

ProcessAttach is our slowest test and runs for about 70s. We spend 60s in the autocontinue test waiting for the target program to terminate.

The reason we wait for the program is that our autocontinue test is not running its command in async mode, and we wait after the attach for the next breakpoint or the program terminates.

This patch makes the attach and autocontinue run in async mode so we don't wait for the program to finish. This reduces the test time from 70s to about 10s.

This also raises the question how this test passes as we seem to wait for the program to finish, but then later still (successfully) check that the program is still running. I think this is either an API quirk or a bug, but that's out of scope for this patch.

>From 50590d0fd728cf473b054ca17da5b5906d0ac4c9 Mon Sep 17 00:00:00 2001
From: Raphael Isemann <rise at apple.com>
Date: Thu, 4 Jun 2026 09:46:46 +0100
Subject: [PATCH] [lldb][test] Speed up ProcessAttach test

ProcessAttach is our slowest test and runs for about 70s. We spend
60s in the autocontinue test waiting for the target program to
terminate.

The reason we wait for the program is that our autocontinue test is
not running its command in async mode, and we wait after the attach
for the next breakpoint or the program terminates.

This patch makes the attach and autocontinue run in async mode so
we don't wait for the program to finish. This reduces the test time
from 70s to about 10s.

This also raises the question how this test passes as we seem to
wait for the program to finish, but then later still (successfully)
check that the program is still running. I think this is either an API
quirk or a bug, but that's out of scope for this patch.
---
 lldb/test/API/commands/process/attach/TestProcessAttach.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lldb/test/API/commands/process/attach/TestProcessAttach.py b/lldb/test/API/commands/process/attach/TestProcessAttach.py
index 15d07737585aa..6d0de6b2b4995 100644
--- a/lldb/test/API/commands/process/attach/TestProcessAttach.py
+++ b/lldb/test/API/commands/process/attach/TestProcessAttach.py
@@ -48,6 +48,8 @@ def test_attach_to_process_by_id_autocontinue(self):
         # Spawn a new process
         popen = self.spawnSubprocess(exe)
 
+        # Don't wait for the continue to finish.
+        self.setAsync(True)
         self.runCmd("process attach -c -p " + str(popen.pid))
 
         target = self.dbg.GetSelectedTarget()



More information about the lldb-commits mailing list