diff options
author | Russ Cox <rsc@golang.org> | 2015-07-20 20:20:05 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2015-07-23 05:37:15 +0000 |
commit | 7334cb3a6fe75ab8343d397041dd94ec935b942b (patch) | |
tree | 7454091f42633db006064f44b092181e368331f4 | |
parent | 5659964d67c9e0b74d8335ea7288fe6facb0d00b (diff) | |
download | go-git-7334cb3a6fe75ab8343d397041dd94ec935b942b.tar.gz |
runtime/trace: fix TestTraceSymbolize networking
We use 127.0.0.1 instead of localhost in Go networking tests.
The reporter of #11774 has localhost defined to be 120.192.83.162,
for reasons unknown.
Also, if TestTraceSymbolize calls Fatalf (for example because Listen
fails) then we need to stop the trace for future tests to work.
See failure log in #11774.
Fixes #11774.
Change-Id: Iceddb03a72d31e967acd2d559ecb78051f9c14b7
Reviewed-on: https://go-review.googlesource.com/12521
Reviewed-by: Rob Pike <r@golang.org>
-rw-r--r-- | src/runtime/trace/trace_stack_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/trace/trace_stack_test.go b/src/runtime/trace/trace_stack_test.go index 061274a4f6..1fca454ed0 100644 --- a/src/runtime/trace/trace_stack_test.go +++ b/src/runtime/trace/trace_stack_test.go @@ -6,6 +6,7 @@ package trace_test import ( "bytes" + "internal/testenv" "internal/trace" "net" "os" @@ -21,13 +22,12 @@ import ( // top uninteresting frames (runtime guts). func TestTraceSymbolize(t *testing.T) { skipTraceTestsIfNeeded(t) - if runtime.GOOS == "nacl" { - t.Skip("skipping: nacl tests fail with 'failed to symbolize trace: failed to start addr2line'") - } + testenv.MustHaveExec(t) buf := new(bytes.Buffer) if err := Start(buf); err != nil { t.Fatalf("failed to start tracing: %v", err) } + defer Stop() // in case of early return // Now we will do a bunch of things for which we verify stacks later. // It is impossible to ensure that a goroutine has actually blocked @@ -78,7 +78,7 @@ func TestTraceSymbolize(t *testing.T) { cv.Wait() cv.L.Unlock() }() - ln, err := net.Listen("tcp", "localhost:0") + ln, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("failed to listen: %v", err) } |