Skip to content

Commit 5430afe

Browse files
committed
[lldb-dap] Fix flaky test
1 parent 6cf656e commit 5430afe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lldb/test/API/tools/lldb-dap/server/TestDAP_server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ def test_server_interrupt(self):
101101
# Interrupt the server which should disconnect all clients.
102102
process.send_signal(signal.SIGINT)
103103

104-
self.dap_server.wait_for_terminated()
104+
# Wait for both events since they can happen in any order.
105+
self.dap_server.wait_for_event(["terminated", "exited"])
106+
self.dap_server.wait_for_event(["terminated", "exited"])
105107
self.assertIsNotNone(
106108
self.dap_server.exit_status,
107109
"Process exited before interrupting lldb-dap server",

lldb/tools/lldb-dap/tool/lldb-dap.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ serveConnection(const Socket::SocketProtocol &protocol, const std::string &name,
351351
<< " disconnected failed: "
352352
<< llvm::toString(std::move(error)) << "\n";
353353
}
354-
// Close the socket to ensure the DAP::Loop read finishes.
355-
sock->Close();
356354
}
357355
}
358356

0 commit comments

Comments
 (0)