Skip to content

Commit

Permalink
runtime/trace: skip tests if parsing fails with timestamp error
Browse files Browse the repository at this point in the history
already skips tests in case of the timestamp error, eg. #97757

Change-Id: Ia696e83cba2e3ed50181a8100b964847092a7365
GitHub-Last-Rev: 8e5f607
GitHub-Pull-Request: #55918
Reviewed-on: https://go-review.googlesource.com/c/go/+/435855
Reviewed-by: Michael Pratt <[email protected]>
Reviewed-by: Joel Sing <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Run-TryBot: Michael Pratt <[email protected]>
  • Loading branch information
doujiang24 authored and 4a6f656c committed Sep 30, 2022
1 parent 9faf6b7 commit d7dbe01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/runtime/crash_cgo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,10 @@ func TestCgoTraceParser(t *testing.T) {
}
output := runTestProg(t, "testprogcgo", "CgoTraceParser")
want := "OK\n"
if output != want {
ErrTimeOrder := "ErrTimeOrder\n"
if output == ErrTimeOrder {
t.Skipf("skipping due to golang.org/issue/16755: %v", output)
} else if output != want {
t.Fatalf("want %s, got %s\n", want, output)
}
}
Expand All @@ -743,7 +746,10 @@ func TestCgoTraceParserWithOneProc(t *testing.T) {
}
output := runTestProg(t, "testprogcgo", "CgoTraceParser", "GOMAXPROCS=1")
want := "OK\n"
if output != want {
ErrTimeOrder := "ErrTimeOrder\n"
if output == ErrTimeOrder {
t.Skipf("skipping due to golang.org/issue/16755: %v", output)
} else if output != want {
t.Fatalf("GOMAXPROCS=1, want %s, got %s\n", want, output)
}
}
4 changes: 3 additions & 1 deletion src/runtime/testdata/testprogcgo/issue29707.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ func CgoTraceParser() {
trace.Stop()

_, err := traceparser.Parse(buf, "")
if err != nil {
if err == traceparser.ErrTimeOrder {
fmt.Println("ErrTimeOrder")
} else if err != nil {
fmt.Println("Parse error: ", err)
} else {
fmt.Println("OK")
Expand Down

0 comments on commit d7dbe01

Please sign in to comment.