Skip to content

Commit 36ceaeb

Browse files
committed
Adding a timeout to the waits to ensure we try to print some logs.
1 parent ca59812 commit 36ceaeb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ def read_packet_thread(vs_comm, log_file):
110110
# Wait for the process to fully exit before dumping the log file to
111111
# ensure we have the entire log contents.
112112
if vs_comm.process is not None:
113-
vs_comm.process.wait()
113+
try:
114+
# Do not wait forever, some logs are better than none.
115+
vs_comm.process.wait(timeout=20)
116+
except subprocess.TimeoutExpired:
117+
pass
114118
dump_dap_log(log_file)
115119

116120

@@ -1278,7 +1282,11 @@ def terminate(self):
12781282
super(DebugAdapterServer, self).terminate()
12791283
if self.process is not None:
12801284
self.process.terminate()
1281-
self.process.wait()
1285+
try:
1286+
self.process.wait(timeout=20)
1287+
except subprocess.TimeoutExpired:
1288+
self.process.kill()
1289+
self.process.wait()
12821290
self.process = None
12831291

12841292

0 commit comments

Comments
 (0)