[all-commits] [llvm/llvm-project] d00710: [lldb-dap][test] Avoid a hang on a test failure (#...
Igor Kudrin via All-commits
all-commits at lists.llvm.org
Fri Jul 17 17:20:44 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d00710093a3d2795200dbf065836220345aa9e9d
https://github.com/llvm/llvm-project/commit/d00710093a3d2795200dbf065836220345aa9e9d
Author: Igor Kudrin <ikudrin at accesssoftek.com>
Date: 2026-07-17 (Fri, 17 Jul 2026)
Changed paths:
M lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
Log Message:
-----------
[lldb-dap][test] Avoid a hang on a test failure (#209988)
Tests in `TestDAP_server.py` create `DebugAdapterServer`, passing a
connection string. `DebugAdapterServer.__init__()` creates a socket and
passes the associated input and output streams to its parent class,
`DebugCommunication`. `DAPTestCaseBase.launch()`, which is called from
`TestDAP_server.run_debug_session()`, adds a teardown hook that
eventually calls `DebugCommunication.terminate()`. If the socket is not
closed when this hook executes, it waits indefinitely for the receiving
thread to join.
In the normal case, when a test passes, the connection is closed by
calling `self.dap_server.request_disconnect()` at the end of
`TestDAP_server.run_debug_session()`. If a test fails, the cleanup hook
is called while the connection is still active, which results in a hang.
This can be reproduced by removing the call to `request_disconnect()` or
by changing the condition in the `assertEqual()` on the previous line.
The fix passes the opened socket to 'DebugCommunication' and closes the
socket explicitly in 'DebugCommunication.terminate()'.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list