[lldb] Fix occasional hangs of VSCode testcases
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 23 Jul 2019 20:45:03 +0000 (20:45 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 23 Jul 2019 20:45:03 +0000 (20:45 +0000)
commit8693f8f9c18282aea953216634db396db7b19220
treefc7cba07031981cb1ad70de70dc1a2fa5f74be2c
parentc5b5cc4575452463360a16c80e1fce25e7e06d31
[lldb] Fix occasional hangs of VSCode testcases

On slower machines the vscode testcases were sometimes hanging:

  1910 ? Sl 0:00 |   \_ /usr/bin/python .../llvm/tools/lldb/test/dotest.py ... -p TestVSCode_setBreakpoints.py
  2649 ? Sl 0:00 |       \_ .../build/bin/lldb-vscode
  2690 ? S  0:00 |           \_ .../build/bin/lldb-server gdbserver --fd=9 --native-regs --setsid
  2708 ? t  0:00 |               \_ .../build/lldb-test-build.noindex/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.test_functionality/a.out

A reproducer of the racy bug for send_recv():
#         self.send_packet(command)
#+        import time
#+        time.sleep(1)
#         done = False

I guess `request_continue` was probably originally intended to be synchronous
but then it isn't and this code has been leftover there.

Differential revision: https://reviews.llvm.org/D65163

llvm-svn: 366850
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py