[Lldb-commits] [lldb] [lldb-dap] refactor monitor thread in tests (PR #172879)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 5 07:34:55 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():
----------------
JDevlieghere wrote:
Why does this need to run in a loop at all? When does `proc.wait` return that we need to send a `kill` again?
https://github.com/llvm/llvm-project/pull/172879
More information about the lldb-commits
mailing list