This is an archive of the discontinued LLVM Phabricator instance.

Make TestVSCode_step pass reliably
ClosedPublic

Authored by labath on Apr 12 2019, 4:58 AM.

Details

Summary

The test was failing occasionally (1% of runs or so), because of
unpredictable timings between the two threads spawned by the test. If
the second thread hit the breakpoint right as we were stepping out of
the function on the first thread, we would still be stuck at the inner
frame when the process stopped.

This would cause errors like:

  File "/home/worker/lldb-x86_64-debian/lldb-x86_64-debian/llvm/tools/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/TestVSCode_step.py", line 67, in test_step
    self.assertEqual(x1, x3, 'verify step out variable')
AssertionError: 2 != 1 : verify step out variable

AFAICT, lldb-vscode is doing the right thing here, and the problem is
that the test is not taking this sequence of events into account. Since
the test is about testing stepping, it does not seem necessary to have
threads in the inferior at all, so I just rewrite the test to execute
the code we're supposed to step through directly on the main thread.

Event Timeline

labath created this revision.Apr 12 2019, 4:58 AM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 21 2019, 6:03 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2019, 6:03 AM

Thanks for the fix!