[Lldb-commits] [lldb] [lldb][test] Speed up ProcessAttach test (PR #201530)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 4 01:49:29 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Raphael Isemann (Teemperor)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/201530.diff
1 Files Affected:
- (modified) lldb/test/API/commands/process/attach/TestProcessAttach.py (+2)
``````````diff
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()
``````````
</details>
https://github.com/llvm/llvm-project/pull/201530
More information about the lldb-commits
mailing list