[Lldb-commits] [PATCH] D85542: lldbutil: add a retry mechanism for the ios simulator

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 7 12:40:27 PDT 2020


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM with the comments addressed. Thanks for fixing this!



================
Comment at: lldb/packages/Python/lldbsuite/test/lldbutil.py:822
+    # Unfortunate workaround for the iPhone simulator.
+    retry = 3
+    while (retry and error.Fail() and
----------------
Nit: can we make this a global constant like SIMULATOR_RETRY?


================
Comment at: lldb/packages/Python/lldbsuite/test/lldbutil.py:824
+    while (retry and error.Fail() and
+           isinstance(error.GetCString(), six.string_types) and
+           "Unable to boot the Simulator" in error.GetCString()):
----------------
aprantl wrote:
> JDevlieghere wrote:
> > Why is this necessary? Is there an error case where `error.GetCString` is not a python string? If so we should probably factor this out in a function and do the `if sys.version_info.major == 2: str.decode('utf-8', 'replace')` trick instead because otherwise the retry won't kick in.
> It may be `None`. So I guess we could write `and error.GetCString()`? I just didn't want to crash on unexpected input.
Got it, yeah then that should be sufficient. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85542/new/

https://reviews.llvm.org/D85542



More information about the lldb-commits mailing list