[lldb/test] Remove sleeps from some lldb-server tests
authorPavel Labath <pavel@labath.sk>
Mon, 7 Feb 2022 19:04:42 +0000 (20:04 +0100)
committerPavel Labath <pavel@labath.sk>
Wed, 9 Feb 2022 10:05:02 +0000 (11:05 +0100)
commit5a4fe166d13bf89e6bc387bd96232e8c0f706d27
treec7f91525736b4f09a93a33420f05dfee92f256b6
parentcdb7675c2649ee91c4e97d84daa76c98cb93b9c4
[lldb/test] Remove sleeps from some lldb-server tests

Instead of using sleeps, have the inferior notify us (via a trap opcode) that
the requested number of threads have been created.

This allows us to get rid of some fairly dodgy test utility code --
wait_for_thread_count seemed like it was waiting for the threads to
appear, but it never actually let the inferior run, so it only succeeded
if the threads were already started when the function was called. Since
the function was called after a fairly small delay (1s, usually), this
is probably the reason why the tests were failing on some bots.

Differential Revision: https://reviews.llvm.org/D119167
lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
lldb/test/API/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
lldb/test/API/tools/lldb-server/main.cpp