[Lldb-commits] [lldb] [lldb-dap] refactor monitor thread in tests (PR #172879)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 5 10:41:46 PST 2026


================
@@ -15,32 +15,39 @@
 # process scheduling can cause a massive (minutes) delay during this test.
 @skipIf(oslist=["linux"], archs=["arm$"])
 class TestDAP_attach(lldbdap_testcase.DAPTestCaseBase):
-    def spawn(self, args):
-        self.process = subprocess.Popen(
-            args,
-            stdin=subprocess.PIPE,
+    def spawn(self, program, args=None):
+        return self.spawnSubprocess(
+            executable=program,
+            args=args,
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
             universal_newlines=True,
         )
 
     def spawn_and_wait(self, program, delay):
         time.sleep(delay)
-        self.spawn([program])
-        self.process.wait()
+        proc = self.spawn(program=program)
+        # Wait for either the process to exit or the event to be set
+        while proc.poll() is None and not self.spawn_event.is_set():
----------------
charles-zablit wrote:

If we set the `spawn_event` the loop exits and we have to `kill` the process, the `wait` is just to wait for the process to be exited.

https://github.com/llvm/llvm-project/pull/172879


More information about the lldb-commits mailing list