aprantl created this revision.
aprantl added reviewers: JDevlieghere, jingham, jasonmolenda, friss.
aprantl requested review of this revision.

We've been seeing this failure on green dragon when the system is under high 
load. Unfortunately this is outside of LLDB's control.


https://reviews.llvm.org/D85542

Files:
  lldb/packages/Python/lldbsuite/test/lldbutil.py


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -818,9 +818,21 @@
     error = lldb.SBError()
     process = target.Launch(launch_info, error)
 
+    # Unfortunate workaround for the iPhone simulator.
+    retry = 3
+    while (retry and error.Fail() and
+           isinstance(error.GetCString(), six.string_types) and
+           "Unable to boot the Simulator" in error.GetCString()):
+        retry -= 1
+        print("** Simulator is unresponsive. Retrying %d more time(s)"%retry)
+        import time
+        time.sleep(60)
+        error = lldb.SBError()
+        process = target.Launch(launch_info, error)
+
     test.assertTrue(process,
-                    "Could not create a valid process for %s: 
%s"%(target.GetExecutable().GetFilename(),
-                    error.GetCString()))
+                    "Could not create a valid process for %s: %s" %
+                    (target.GetExecutable().GetFilename(), error.GetCString()))
     test.assertFalse(error.Fail(),
                      "Process launch failed: %s" % (error.GetCString()))
 


Index: lldb/packages/Python/lldbsuite/test/lldbutil.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -818,9 +818,21 @@
     error = lldb.SBError()
     process = target.Launch(launch_info, error)
 
+    # Unfortunate workaround for the iPhone simulator.
+    retry = 3
+    while (retry and error.Fail() and
+           isinstance(error.GetCString(), six.string_types) and
+           "Unable to boot the Simulator" in error.GetCString()):
+        retry -= 1
+        print("** Simulator is unresponsive. Retrying %d more time(s)"%retry)
+        import time
+        time.sleep(60)
+        error = lldb.SBError()
+        process = target.Launch(launch_info, error)
+
     test.assertTrue(process,
-                    "Could not create a valid process for %s: %s"%(target.GetExecutable().GetFilename(),
-                    error.GetCString()))
+                    "Could not create a valid process for %s: %s" %
+                    (target.GetExecutable().GetFilename(), error.GetCString()))
     test.assertFalse(error.Fail(),
                      "Process launch failed: %s" % (error.GetCString()))
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to