Commit 7334cb3a authored by Russ Cox's avatar Russ Cox

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/12521Reviewed-by: default avatarRob Pike <r@golang.org>
parent 5659964d
......@@ -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)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment