Author: Charles Zablit
Date: 2026-01-09T14:49:21Z
New Revision: fb47a252add015f5f60f404ad85acb13a3ced27d

URL: 
https://github.com/llvm/llvm-project/commit/fb47a252add015f5f60f404ad85acb13a3ced27d
DIFF: 
https://github.com/llvm/llvm-project/commit/fb47a252add015f5f60f404ad85acb13a3ced27d.diff

LOG: [lldb-dap] add timeout to spawn_and_wait test utility (#174461)

Added: 
    

Modified: 
    lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py 
b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
index 00facfbc60ad5..5810be67a2bf9 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
@@ -27,8 +27,12 @@ def spawn(self, program, args=None):
     def spawn_and_wait(self, program, delay):
         time.sleep(delay)
         proc = self.spawn(program=program)
-        # Wait for either the process to exit or the event to be set
+        start_time = time.time()
+        # 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():
+            elapsed = time.time() - start_time
+            if elapsed >= self.DEFAULT_TIMEOUT:
+                break
             time.sleep(0.1)
         proc.kill()
         proc.wait()


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to