[all-commits] [llvm/llvm-project] 979040: Reland "[lldb] [test] Improve stability of llgs vC...

Michał Górny via All-commits all-commits at lists.llvm.org
Mon Jul 11 09:05:27 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9790406a9226e112e75eeeac1c326cff9b570264
      https://github.com/llvm/llvm-project/commit/9790406a9226e112e75eeeac1c326cff9b570264
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-07-11 (Mon, 11 Jul 2022)

  Changed paths:
    R lldb/test/API/tools/lldb-server/vCont-threads/TestGdbRemote_vContThreads.py
    A lldb/test/API/tools/lldb-server/vCont-threads/TestPartialResume.py
    A lldb/test/API/tools/lldb-server/vCont-threads/TestSignal.py
    M lldb/test/API/tools/lldb-server/vCont-threads/main.cpp

  Log Message:
  -----------
  Reland "[lldb] [test] Improve stability of llgs vCont-threads tests"

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 SIGINT 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.

Add a mutex for output to guarantee serialization.  A barrier is used
to guarantee that all threads start before SIGINT, and an atomic bool
is used to delay prints from happening until after SIGINT.

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

This fixes the test hangs on FreeBSD.  Hopefully, it will also fix all
the flakiness on buildbots.

Thanks to Pavel Labath for figuring out why the original version did not
work on Debian.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D129012




More information about the All-commits mailing list