diff --git a/pkg/proc/proc_test.go b/pkg/proc/proc_test.go index 8a4101656853d65f562e0e1a4279f3d77eb3180c..3ea5c6e7e6d7ca52f9af490adcea15d5e38dee25 100644 --- a/pkg/proc/proc_test.go +++ b/pkg/proc/proc_test.go @@ -1302,23 +1302,9 @@ func TestFrameEvaluation(t *testing.T) { found[vval] = true } - firsterr := false - if goversion.VersionAfterOrEqual(runtime.Version(), 1, 14) { - // We try to make sure that all goroutines are stopped at a sensible place - // before reading their stacktrace, but due to the nature of the test - // program there is no guarantee that we always find them in a reasonable - // state. - // Asynchronous preemption in Go 1.14 exacerbates this problem, to avoid - // unnecessary flakiness allow a single goroutine to be in a bad state. - firsterr = true - } for i := range found { if !found[i] { - if firsterr { - firsterr = false - } else { - t.Fatalf("Goroutine %d not found\n", i) - } + t.Fatalf("Goroutine %d not found\n", i) } } diff --git a/service/test/integration1_test.go b/service/test/integration1_test.go index 08966c529f0f97b121f25c3f9f3fef7e5ab9e323..8b5afdaba80301e3c5ab535a8fdf785a89694a1c 100644 --- a/service/test/integration1_test.go +++ b/service/test/integration1_test.go @@ -730,19 +730,20 @@ func Test1ClientServer_FullStacktrace(t *testing.T) { for _, g := range gs { frames, err := c.Stacktrace(g.ID, 10, true) assertNoError(err, t, fmt.Sprintf("Stacktrace(%d)", g.ID)) + t.Logf("goroutine %d", g.ID) for i, frame := range frames { + t.Logf("\tframe %d off=%#x bpoff=%#x pc=%#x %s:%d %s", i, frame.FrameOffset, frame.FramePointerOffset, frame.PC, frame.File, frame.Line, frame.Function.Name()) if frame.Function == nil { continue } if frame.Function.Name() != "main.agoroutine" { continue } - t.Logf("frame %d: %v", i, frame) for _, arg := range frame.Arguments { if arg.Name != "i" { continue } - t.Logf("frame %d, variable i is %v\n", i, arg) + t.Logf("\tvariable i is %+v\n", arg) argn, err := strconv.Atoi(arg.Value) if err == nil { found[argn] = true @@ -757,6 +758,8 @@ func Test1ClientServer_FullStacktrace(t *testing.T) { } } + t.Logf("continue") + state = <-c.Continue() if state.Err != nil { t.Fatalf("Continue(): %v\n", state.Err) @@ -767,10 +770,10 @@ func Test1ClientServer_FullStacktrace(t *testing.T) { cur := 3 for i, frame := range frames { + t.Logf("\tframe %d off=%#x bpoff=%#x pc=%#x %s:%d %s", i, frame.FrameOffset, frame.FramePointerOffset, frame.PC, frame.File, frame.Line, frame.Function.Name()) if i == 0 { continue } - t.Logf("frame %d: %v", i, frame) v := frame.Var("n") if v == nil { t.Fatalf("Could not find value of variable n in frame %d", i) diff --git a/service/test/integration2_test.go b/service/test/integration2_test.go index 06527e145ef1d11171bad2d55670249e1b48b584..e0468a6b83e6f1dd998790415c10506413da18e8 100644 --- a/service/test/integration2_test.go +++ b/service/test/integration2_test.go @@ -925,19 +925,20 @@ func TestClientServer_FullStacktrace(t *testing.T) { for _, g := range gs { frames, err := c.Stacktrace(g.ID, 10, 0, &normalLoadConfig) assertNoError(err, t, fmt.Sprintf("Stacktrace(%d)", g.ID)) + t.Logf("goroutine %d", g.ID) for i, frame := range frames { + t.Logf("\tframe %d off=%#x bpoff=%#x pc=%#x %s:%d %s", i, frame.FrameOffset, frame.FramePointerOffset, frame.PC, frame.File, frame.Line, frame.Function.Name()) if frame.Function == nil { continue } if frame.Function.Name() != "main.agoroutine" { continue } - t.Logf("frame %d: %v", i, frame) for _, arg := range frame.Arguments { if arg.Name != "i" { continue } - t.Logf("frame %v, variable i is %v\n", frame, arg) + t.Logf("\tvariable i is %+v\n", arg) argn, err := strconv.Atoi(arg.Value) if err == nil { found[argn] = true @@ -952,6 +953,8 @@ func TestClientServer_FullStacktrace(t *testing.T) { } } + t.Logf("continue") + state = <-c.Continue() if state.Err != nil { t.Fatalf("Continue(): %v\n", state.Err) @@ -962,10 +965,10 @@ func TestClientServer_FullStacktrace(t *testing.T) { cur := 3 for i, frame := range frames { + t.Logf("\tframe %d off=%#x bpoff=%#x pc=%#x %s:%d %s", i, frame.FrameOffset, frame.FramePointerOffset, frame.PC, frame.File, frame.Line, frame.Function.Name()) if i == 0 { continue } - t.Logf("frame %d: %v", i, frame) v := frame.Var("n") if v == nil { t.Fatalf("Could not find value of variable n in frame %d", i)