Skip to content

Commit

Permalink
[lldb][test][NFC] TestBreakpointSetRestart.py: split up assertion to …
Browse files Browse the repository at this point in the history
…determine which check specifically fails in CI

This test consistently fails on the public macOS ASAN CI (and isn't
reproducible locally):
```
FAIL: test_breakpoint_set_restart_dwarf
(TestBreakpointSetRestart.BreakpointSetRestart)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 1756, in test_method
    return attrvalue(self)
  File
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py",
line 150, in wrapper
    return func(*args, **kwargs)
  File
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py",
line 36, in test_breakpoint_set_restart
    self.assertTrue(bp.IsValid() and bp.GetNumLocations() == 1,
VALID_BREAKPOINT)
AssertionError: False is not true : Got a valid breakpoint
```

From this error we're not quite sure what about the breakpoint here is
the problem.

This patch splits up the assertion to narrow down the issue.
  • Loading branch information
Michael137 committed Jun 3, 2024
1 parent 6b7b05b commit aad7874
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def test_breakpoint_set_restart(self):
bp = target.BreakpointCreateBySourceRegex(
self.BREAKPOINT_TEXT, lldb.SBFileSpec("main.cpp")
)
self.assertTrue(bp.IsValid() and bp.GetNumLocations() == 1, VALID_BREAKPOINT)
self.assertTrue(bp.IsValid(), VALID_BREAKPOINT)
self.assertEqual(bp.GetNumLocations(), 1, VALID_BREAKPOINT)

while self.dbg.GetListener().WaitForEvent(2, event):
if lldb.SBProcess.GetStateFromEvent(
Expand Down

0 comments on commit aad7874

Please sign in to comment.