Author: Charles Zablit
Date: 2026-02-25T12:47:40Z
New Revision: 668870c721fb498b7011e52c241c6416b6afc70d

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

LOG: [lldb][windows] add a 50ms sleep when closing the ConPTY (#183280)

Since https://github.com/llvm/llvm-project/pull/182302 was merged,
`x86-64-gp-write.test` is flaky.

This patch reintroduces the 50ms sleep that was removed in
https://github.com/llvm/llvm-project/pull/182302 to fix the flakyness
while we investigate it.

Added: 
    

Modified: 
    lldb/source/Host/windows/PseudoConsole.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/windows/PseudoConsole.cpp 
b/lldb/source/Host/windows/PseudoConsole.cpp
index da4b1310ea17c..03ebabc2d8f75 100644
--- a/lldb/source/Host/windows/PseudoConsole.cpp
+++ b/lldb/source/Host/windows/PseudoConsole.cpp
@@ -138,6 +138,10 @@ bool PseudoConsole::IsConnected() const {
 }
 
 void PseudoConsole::Close() {
+  Sleep(50); // FIXME: This mitigates a race condition when closing the
+             // PseudoConsole. It's possible that there is still data in the
+             // pipe when we try to close it. We should wait until the data has
+             // been consumed.
   SetStopping(true);
   std::unique_lock<std::mutex> guard(m_mutex);
   if (m_conpty_handle != INVALID_HANDLE_VALUE)


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

Reply via email to