diff options
author | Elias Naur <elias.naur@gmail.com> | 2018-05-08 10:21:09 +0200 |
---|---|---|
committer | Elias Naur <elias.naur@gmail.com> | 2018-05-08 15:00:57 +0000 |
commit | 704893b16be5ab99913ee04c615d570ad5d57027 (patch) | |
tree | f29d141dea3404a20d68119475d354cb0ac90502 /misc/ios | |
parent | 1b49487692ec90e5438ae97cf3bbcb515bb47796 (diff) | |
download | go-704893b16be5ab99913ee04c615d570ad5d57027.tar.gz go-704893b16be5ab99913ee04c615d570ad5d57027.zip |
misc/ios: retry iOS launch even if no device app path was found
Now that the iOS exec wrapper uninstalls any existing test app before
installing a new, looking up the device app path might fail. Before,
the lookup always succeeded (even though the path reported might be
stale).
For the iOS builder.
Change-Id: I5667b6fae15f88745bdee796db219a429a26e203
Reviewed-on: https://go-review.googlesource.com/112075
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Diffstat (limited to 'misc/ios')
-rw-r--r-- | misc/ios/go_darwin_arm_exec.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/misc/ios/go_darwin_arm_exec.go b/misc/ios/go_darwin_arm_exec.go index 50e0342f67..11219ce5c7 100644 --- a/misc/ios/go_darwin_arm_exec.go +++ b/misc/ios/go_darwin_arm_exec.go @@ -469,12 +469,17 @@ func run(appdir, bundleID string, args []string) error { } attempt := 0 for { - // The device app path is constant for a given installed app, - // but the device might not return a stale device path for - // a newly overwritten app, so retry the lookup as well. + // The device app path reported by the device might be stale, so retry + // the lookup of the device path along with the lldb launching below. deviceapp, err := findDeviceAppPath(bundleID) if err != nil { - return err + // The device app path might not yet exist for a newly installed app. + if attempt == 5 { + return err + } + attempt++ + time.Sleep(5 * time.Second) + continue } lldb := exec.Command( "python", |