Skip to content

Commit

Permalink
cmd/trace: skip GoroutineInSyscall in case time order err
Browse files Browse the repository at this point in the history
All tests involving trace collection and parsing
still need handling of failures caused by #16755
(Timestamp issue)

Fixes #24738

Change-Id: I6cd0f9c6f49854a22fad6fce1a00964c168aa614
Reviewed-on: https://go-review.googlesource.com/105821
Reviewed-by: Peter Weinberger <[email protected]>
  • Loading branch information
hyangah committed Apr 10, 2018
1 parent 1a677e0 commit efa0d1f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/cmd/trace/trace_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ package main

import (
"bytes"
"internal/trace"
traceparser "internal/trace"
"io/ioutil"
"runtime"
rtrace "runtime/trace"
"runtime/trace"
"sync"
"syscall"
"testing"
Expand Down Expand Up @@ -68,13 +68,15 @@ func TestGoroutineInSyscall(t *testing.T) {

// Collect and parse trace.
buf := new(bytes.Buffer)
if err := rtrace.Start(buf); err != nil {
if err := trace.Start(buf); err != nil {
t.Fatalf("failed to start tracing: %v", err)
}
rtrace.Stop()
trace.Stop()

res, err := trace.Parse(buf, "")
if err != nil {
res, err := traceparser.Parse(buf, "")
if err == traceparser.ErrTimeOrder {
t.Skipf("skipping due to golang.org/issue/16755 (timestamps are unreliable): %v", err)
} else if err != nil {
t.Fatalf("failed to parse trace: %v", err)
}

Expand Down

0 comments on commit efa0d1f

Please sign in to comment.