[Lldb-commits] [lldb] 968cba8 - lldbutil: add a retry mechanism for the ios simulator
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 7 13:28:54 PDT 2020
Author: Adrian Prantl
Date: 2020-08-07T13:28:46-07:00
New Revision: 968cba8e89f7226f325b04278d3b5dff7d4ebc36
URL: https://github.com/llvm/llvm-project/commit/968cba8e89f7226f325b04278d3b5dff7d4ebc36
DIFF: https://github.com/llvm/llvm-project/commit/968cba8e89f7226f325b04278d3b5dff7d4ebc36.diff
LOG: lldbutil: add a retry mechanism for the ios simulator
We've been seeing this failure on green dragon when the system is
under high load. Unfortunately this is outside of LLDB's control.
Differential Revision: https://reviews.llvm.org/D85542
Added:
Modified:
lldb/packages/Python/lldbsuite/test/lldbutil.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index 1b366f295540..4eb407638903 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/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 @@ def run_to_breakpoint_do_run(test, target, bkpt, launch_info = None,
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()))
More information about the lldb-commits
mailing list