[Lldb-commits] [lldb] r268653 - Fix TestEvents.py on OS X

Todd Fiala via lldb-commits lldb-commits at lists.llvm.org
Thu May 5 10:48:14 PDT 2016

Author: tfiala
Date: Thu May  5 12:48:14 2016
New Revision: 268653

URL: http://llvm.org/viewvc/llvm-project?rev=268653&view=rev
Fix TestEvents.py on OS X

This change addresses a hang/segfault in TestEvents.py. The threads that
run the listener loops now do an SBListener.Clear() before they wrap up
their work. This prevents the test from trying to clean up the
SBListener too late.

There is a separate issue here which is that we should prevent this
clean-up time lock-up, but that is out of scope for this particular
change. I'd like to get these tests back and running the normal flow
rather than skipping them.

This addresses:
llvm.org/pr25924 (at least, the OS X side, although I suspect this will
also address Linux)

reviewed by: Jim Ingham


Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py?rev=268653&r1=268652&r2=268653&view=diff
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py Thu May  5 12:48:14 2016
@@ -13,7 +13,6 @@ from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
- at skipIfDarwin  # llvm.org/pr25924, sometimes generating SIGSEGV
 @skipIfLinux   # llvm.org/pr25924, sometimes generating SIGSEGV
 class EventAPITestCase(TestBase):
@@ -86,6 +85,7 @@ class EventAPITestCase(TestBase):
                         if traceOn:
                             print("timeout occurred waiting for event...")
                     count = count + 1
+                listener.Clear()
         # Let's start the listening thread to retrieve the events.
@@ -103,6 +103,8 @@ class EventAPITestCase(TestBase):
         # Wait until the 'MyListeningThread' terminates.
+        # Shouldn't we be testing against some kind of expectation here?
     @expectedFlakeyLinux("llvm.org/pr23730") # Flaky, fails ~1/100 cases
     def test_wait_for_event(self):
@@ -155,10 +157,11 @@ class EventAPITestCase(TestBase):
                         #print("Got a valid event:", event)
                         #print("Event data flavor:", event.GetDataFlavor())
                         #print("Event type:", lldbutil.state_type_to_str(event.GetType()))
+                        listener.Clear()
                     count = count + 1
                     print("Timeout: listener.WaitForEvent")
+                listener.Clear()
         # Use Python API to kill the process.  The listening thread should be
@@ -266,7 +269,7 @@ class EventAPITestCase(TestBase):
                     count = count + 1
                     if count > 6:
+                listener.Clear()
         # Use Python API to continue the process.  The listening thread should be

More information about the lldb-commits mailing list