This revision was automatically updated to reflect the committed changes.
Closed by commit rG968cba8e89f7: lldbutil: add a retry mechanism for the ios
simulator (authored by aprantl).
Herald added a project: LLDB.
Changed prior to commit:
https://reviews.llvm.org/D85542?vs=283995&id=284020#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85542/new/
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
@@ -21,6 +21,8 @@
import lldb
from . import lldbtest_config
+# How often failed simulator process launches are retried.
+SIMULATOR_RETRY = 3
# ===================================================
# Utilities for locating/checking executable programs
@@ -818,9 +820,20 @@
error = lldb.SBError()
process = target.Launch(launch_info, error)
+ # Unfortunate workaround for the iPhone simulator.
+ retry = SIMULATOR_RETRY
+ while (retry and error.Fail() and error.GetCString() 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
@@ -21,6 +21,8 @@
import lldb
from . import lldbtest_config
+# How often failed simulator process launches are retried.
+SIMULATOR_RETRY = 3
# ===================================================
# Utilities for locating/checking executable programs
@@ -818,9 +820,20 @@
error = lldb.SBError()
process = target.Launch(launch_info, error)
+ # Unfortunate workaround for the iPhone simulator.
+ retry = SIMULATOR_RETRY
+ while (retry and error.Fail() and error.GetCString() 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
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits