[lldb-dev] Failing LIT-based lldb-mi tests

Adrian Prantl via lldb-dev lldb-dev at lists.llvm.org
Fri Aug 10 11:13:16 PDT 2018


[+lldb-dev, since this affects all bots equally]

Alexander, it looks like there is a race condition in some of the LIT-based lldb-mi tests.

For example, exec-next.test:

  # Test lldb-mi -exec-next command.

  # Check that we have a valid target created via '%lldbmi %t'.
  # CHECK: ^done

  -break-insert main
  # CHECK: ^done,bkpt={number="1"

  -exec-run
  # CHECK: ^running
  # CHECK: *stopped,reason="breakpoint-hit"

  -exec-next --thread 0
  # Check that exec-next can process the case of invalid thread ID.
  # CHECK: ^error,msg="Command 'exec-next'. Thread ID invalid"

  ...

Here we are not actually waiting for the breakpoint to be hit. Synchronous mode ensures that the lldb-mi driver waits for each command to be completed, but that only means that -exec-run only returns after the process has been launched and does not include waiting for the program to actually hit a breakpoint. So if the program runs very slowly (such as often happens on a very busy bot), the -exec-next and subsequent commands are scheduled before the breakpoint is hit. In order to fix this we either need to move any tests that schedule commands after hitting breakpoints back to Python, or we need to add a new -wait-for-breakpoint MI command for testing only to force a synchronization point.

Could you please take look?

-- adrian


More information about the lldb-dev mailing list