[Lldb-commits] [PATCH] D120607: [lldb/test] Re-enable TestEvents.py on Darwin and fix crashes

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 25 20:49:12 PST 2022


mib created this revision.
mib added a reviewer: JDevlieghere.
mib added a project: LLDB.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

This patch re-enables TestEvents.py on Darwin and fixes some crashes
that were happening due to an undefined method.

I ran it 100 times locally with the following command and it passed
every the time:

  for i in {1..100}; do print $i/100; ./bin/lldb-dotest -p TestEvents.py 2>&1 | rg PASSED; if [ "$?" -eq "1" ]; then break; fi; done

Let's see if it still fails non-deterministically on the bots and
eventually also re-enable it on linux.

rdar://37037235

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120607

Files:
  lldb/test/API/python_api/event/TestEvents.py


Index: lldb/test/API/python_api/event/TestEvents.py
===================================================================
--- lldb/test/API/python_api/event/TestEvents.py
+++ lldb/test/API/python_api/event/TestEvents.py
@@ -13,7 +13,6 @@
 
 
 @skipIfLinux   # llvm.org/pr25924, sometimes generating SIGSEGV
- at skipIfDarwin
 class EventAPITestCase(TestBase):
 
     mydir = TestBase.compute_mydir(__file__)
@@ -171,9 +170,9 @@
                 # Let's only try at most 3 times to retrieve any kind of event.
                 while not count > 3:
                     if listener.WaitForEvent(5, event):
-                        self.trace("Got a valid event:", event)
-                        self.trace("Event data flavor:", event.GetDataFlavor())
-                        self.trace("Event type:", lldbutil.state_type_to_str(event.GetType()))
+                        self.context.trace("Got a valid event:", event)
+                        self.context.trace("Event data flavor:", event.GetDataFlavor())
+                        self.context.trace("Event type:", lldbutil.state_type_to_str(event.GetType()))
                         listener.Clear()
                         return
                     count = count + 1
@@ -187,6 +186,7 @@
 
         # Let's start the listening thread to retrieve the event.
         my_thread = MyListeningThread()
+        my_thread.context = self
         my_thread.start()
 
         # Wait until the 'MyListeningThread' terminates.
@@ -256,7 +256,7 @@
         class MyListeningThread(threading.Thread):
 
             def run(self):
-                self.trace("Running MyListeningThread:", self)
+                self.context.trace("Running MyListeningThread:", self)
 
                 # Regular expression pattern for the event description.
                 pattern = re.compile("data = {.*, state = (.*)}$")
@@ -266,7 +266,7 @@
                 while True:
                     if listener.WaitForEvent(5, event):
                         desc = lldbutil.get_description(event)
-                        self.trace("Event description:", desc)
+                        self.context.trace("Event description:", desc)
                         match = pattern.search(desc)
                         if not match:
                             break


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120607.411570.patch
Type: text/x-patch
Size: 2286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220226/10b17125/attachment.bin>


More information about the lldb-commits mailing list