[Lldb-commits] [PATCH] D129012: [lldb] [test] Improve stability of llgs vCont-threads tests

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 1 12:09:23 PDT 2022


mgorny created this revision.
mgorny added reviewers: labath, emaste, krytarowski, jingham.
Herald added a subscriber: arichardson.
Herald added a project: All.
mgorny requested review of this revision.

Perform a major refactoring of vCont-threads tests in order to attempt
to improve their stability and performance.

Split test_vCont_run_subset_of_threads() into smaller test cases,
and split the whole suite into two files: one for signal-related tests,
the running-subset-of tests.

Eliminate output_match checks entirely, as they are fragile to
fragmentation of output.  Instead, for the initial thread list capture
raise an explicit SIGSTOP from inside the test program, and for
the remaining output let the test program run until exit, and check all
the captured output afterwards.

For resume tests, capture the LLDB's thread view before and after
starting new threads in order to determine the IDs corresponding
to subthreads rather than relying on program output for that.

Use write(2) for output, as using std::printf() seems to be fragile
to the output being interspersed between threads mid-line.

Call std::this_thread::yield() to reduce the risk of one of the threads
not being run.

Incidentally, this seems to stop the tests from hanging on FreeBSD.
Hopefully, it will also fix all the flakiness.

Sponsored by: The FreeBSD Foundation


https://reviews.llvm.org/D129012

Files:
  lldb/test/API/tools/lldb-server/vCont-threads/TestGdbRemote_vContThreads.py
  lldb/test/API/tools/lldb-server/vCont-threads/TestPartialResume.py
  lldb/test/API/tools/lldb-server/vCont-threads/TestSignal.py
  lldb/test/API/tools/lldb-server/vCont-threads/main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129012.441767.patch
Type: text/x-patch
Size: 12008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220701/993a6006/attachment.bin>


More information about the lldb-commits mailing list