1
0
mirror of https://github.com/golang/go synced 2024-11-23 07:20:06 -07:00

misc/ios: simplify breakpoint timeout

The clever partial timer I added interacts badly with iOS app launch
timeout termination. A fixed timeout will be easier to debug.

Change-Id: I6eb4ee5f1431539f00fa707e8cde6f3cf86983fc
Reviewed-on: https://go-review.googlesource.com/8083
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
David Crawshaw 2015-03-25 13:22:32 -04:00
parent ed92862522
commit 713451a097

View File

@ -150,10 +150,8 @@ func run(bin string, args []string) (err error) {
// Manage the -test.timeout here, outside of the test. There is a lot // Manage the -test.timeout here, outside of the test. There is a lot
// of moving parts in an iOS test harness (notably lldb) that can // of moving parts in an iOS test harness (notably lldb) that can
// swallow useful stdio or cause its own ruckus. // swallow useful stdio or cause its own ruckus.
brTimeout := 5 * time.Second
var timedout chan struct{} var timedout chan struct{}
if t := parseTimeout(args); t > 1*time.Second { if t := parseTimeout(args); t > 1*time.Second {
brTimeout = t / 4
timedout = make(chan struct{}) timedout = make(chan struct{})
time.AfterFunc(t-1*time.Second, func() { time.AfterFunc(t-1*time.Second, func() {
close(timedout) close(timedout)
@ -209,7 +207,7 @@ func run(bin string, args []string) (err error) {
fmt.Fprintln(lldb, `run`) fmt.Fprintln(lldb, `run`)
// Sometimes we don't see "reason = breakpoint", so we time out // Sometimes we don't see "reason = breakpoint", so we time out
// and try to continue. // and try to continue.
if err := waitFor("br getwd", "stop reason = breakpoint", brTimeout); err != nil { if err := waitFor("br getwd", "stop reason = breakpoint", 10*time.Second); err != nil {
return err return err
} }
if err := waitFor("br getwd prompt", "(lldb)", 0); err != nil { if err := waitFor("br getwd prompt", "(lldb)", 0); err != nil {