[Lldb-commits] [lldb] r349491 - de-flake TestThreadStates.test_process_interrupt

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 18 07:15:02 PST 2018


Author: labath
Date: Tue Dec 18 07:15:02 2018
New Revision: 349491

URL: http://llvm.org/viewvc/llvm-project?rev=349491&view=rev
Log:
de-flake TestThreadStates.test_process_interrupt

the "self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)"
was occasionally failing because the stop reason would come out as
"trace" this happened if we issued the interrupt just as the processed
stopped due to single-stepping over the breakpoint (i.e., the it was not
necessary to send any signal).

Fix this by removing the breakpoint before resuming the process. This
ensures the process can run unobstructed.

After this, the test passed 200 consecutive runs successfully for me,
even while the system was under heavy load.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py?rev=349491&r1=349490&r2=349491&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py Tue Dec 18 07:15:02 2018
@@ -199,7 +199,7 @@ class ThreadStateTestCase(TestBase):
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
-        lldbutil.run_break_set_by_file_and_line(
+        bpno = lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.break_1, num_expected_locations=1)
 
         # Run the program.
@@ -213,6 +213,10 @@ class ThreadStateTestCase(TestBase):
             process, lldb.eStopReasonBreakpoint)
         self.assertIsNotNone(thread)
 
+        # Remove the breakpoint to avoid the single-step-over-bkpt dance in the
+        # "continue" below
+        self.assertTrue(target.BreakpointDelete(bpno))
+
         # Continue, the inferior will go into an infinite loop waiting for
         # 'g_test' to change.
         self.dbg.SetAsync(True)




More information about the lldb-commits mailing list