DavidSpickett created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

This test runs to a breakpoint on thread 0. Thread 0 then starts
thread 2 and 3, which both have breakpoints in them.

In https://lab.llvm.org/buildbot/#/builders/96/builds/41674
I think that we managed to do the first check on thread 2 before
thread 3 had started. Therefore "thread continue 3" failed.

So wait for all three to startup before we check their status.

I considered putting a timeout on the while like the wait_for... methods,
but the test itself already has a global timeout. Plus, I'd rather
not be tuning a timeout per piece of hardware this runs on.

99% of the time we will already have 3 threads when the check is done.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154705

Files:
  
lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py


Index: 
lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
===================================================================
--- 
lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
+++ 
lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
@@ -125,8 +125,6 @@
 
         process = self.dbg.GetSelectedTarget().GetProcess()
 
-        thread1 = process.GetThreadAtIndex(0)
-
         self.expect(
             "thread info 1",
             STOPPED_DUE_TO_BREAKPOINT,
@@ -140,6 +138,10 @@
 
         self.runCmd("process continue", RUN_SUCCEEDED)
 
+        # If we start the checks too quickly, thread 3 may not have started.
+        while (process.GetNumThreads() < 3):
+            pass
+
         for idx in range(1, process.GetNumThreads()):
             thread = process.GetThreadAtIndex(idx)
             if thread.GetStopReason() != lldb.eStopReasonBreakpoint:


Index: lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
===================================================================
--- lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
+++ lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
@@ -125,8 +125,6 @@
 
         process = self.dbg.GetSelectedTarget().GetProcess()
 
-        thread1 = process.GetThreadAtIndex(0)
-
         self.expect(
             "thread info 1",
             STOPPED_DUE_TO_BREAKPOINT,
@@ -140,6 +138,10 @@
 
         self.runCmd("process continue", RUN_SUCCEEDED)
 
+        # If we start the checks too quickly, thread 3 may not have started.
+        while (process.GetNumThreads() < 3):
+            pass
+
         for idx in range(1, process.GetNumThreads()):
             thread = process.GetThreadAtIndex(idx)
             if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PAT... David Spickett via Phabricator via lldb-commits

Reply via email to