Skip to content

Commit 2a29c3f

Browse files
committed
[lldb/test] Re-enable TestEvents.py on Darwin and fix crashes
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 Differential Revision: https://reviews.llvm.org/D120607 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 22b6e81 commit 2a29c3f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414

1515
@skipIfLinux # llvm.org/pr25924, sometimes generating SIGSEGV
16-
@skipIfDarwin
1716
class EventAPITestCase(TestBase):
1817

1918
mydir = TestBase.compute_mydir(__file__)
@@ -171,9 +170,9 @@ def run(self):
171170
# Let's only try at most 3 times to retrieve any kind of event.
172171
while not count > 3:
173172
if listener.WaitForEvent(5, event):
174-
self.trace("Got a valid event:", event)
175-
self.trace("Event data flavor:", event.GetDataFlavor())
176-
self.trace("Event type:", lldbutil.state_type_to_str(event.GetType()))
173+
self.context.trace("Got a valid event:", event)
174+
self.context.trace("Event data flavor:", event.GetDataFlavor())
175+
self.context.trace("Event type:", lldbutil.state_type_to_str(event.GetType()))
177176
listener.Clear()
178177
return
179178
count = count + 1
@@ -187,6 +186,7 @@ def run(self):
187186

188187
# Let's start the listening thread to retrieve the event.
189188
my_thread = MyListeningThread()
189+
my_thread.context = self
190190
my_thread.start()
191191

192192
# Wait until the 'MyListeningThread' terminates.
@@ -256,7 +256,7 @@ def test_add_listener_to_broadcaster(self):
256256
class MyListeningThread(threading.Thread):
257257

258258
def run(self):
259-
self.trace("Running MyListeningThread:", self)
259+
self.context.trace("Running MyListeningThread:", self)
260260

261261
# Regular expression pattern for the event description.
262262
pattern = re.compile("data = {.*, state = (.*)}$")
@@ -266,7 +266,7 @@ def run(self):
266266
while True:
267267
if listener.WaitForEvent(5, event):
268268
desc = lldbutil.get_description(event)
269-
self.trace("Event description:", desc)
269+
self.context.trace("Event description:", desc)
270270
match = pattern.search(desc)
271271
if not match:
272272
break

0 commit comments

Comments
 (0)