(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestAggregateNotAggressive(t *testing.T) { |
| 18 | t.Parallel() |
| 19 | // 2 goroutines with similar but not exact same signature. |
| 20 | data := []string{ |
| 21 | "panic: runtime error: index out of range", |
| 22 | "", |
| 23 | "goroutine 6 [chan receive]:", |
| 24 | "main.func·001({0x11000000, 2}, 3)", |
| 25 | "\t/gopath/src/github.com/maruel/panicparse/stack/stack.go:72 +0x49", |
| 26 | "", |
| 27 | "goroutine 7 [chan receive]:", |
| 28 | "main.func·001({0x21000000, 2}, 3)", |
| 29 | "\t/gopath/src/github.com/maruel/panicparse/stack/stack.go:72 +0x49", |
| 30 | "", |
| 31 | } |
| 32 | s, suffix, err := ScanSnapshot(bytes.NewBufferString(strings.Join(data, "\n")), io.Discard, defaultOpts()) |
| 33 | if err != io.EOF { |
| 34 | t.Fatal(err) |
| 35 | } |
| 36 | if s == nil { |
| 37 | t.Fatal("expected snapshot") |
| 38 | } |
| 39 | want := []*Bucket{ |
| 40 | { |
| 41 | Signature: Signature{ |
| 42 | State: "chan receive", |
| 43 | Stack: Stack{ |
| 44 | Calls: []Call{ |
| 45 | newCall( |
| 46 | "main.func·001", |
| 47 | Args{Values: []Arg{ |
| 48 | {IsAggregate: true, Fields: Args{ |
| 49 | Values: []Arg{{Value: 0x11000000, IsPtr: true}, {Value: 2}}, |
| 50 | }}, |
| 51 | {Value: 3}, |
| 52 | }}, |
| 53 | "/gopath/src/github.com/maruel/panicparse/stack/stack.go", |
| 54 | 72), |
| 55 | }, |
| 56 | }, |
| 57 | }, |
| 58 | IDs: []int{6}, |
| 59 | First: true, |
| 60 | }, |
| 61 | { |
| 62 | Signature: Signature{ |
| 63 | State: "chan receive", |
| 64 | Stack: Stack{ |
| 65 | Calls: []Call{ |
| 66 | newCall( |
| 67 | "main.func·001", |
| 68 | Args{Values: []Arg{ |
| 69 | {IsAggregate: true, Fields: Args{ |
| 70 | Values: []Arg{{Value: 0x21000000, Name: "#1", IsPtr: true}, {Value: 2}}, |
| 71 | }}, |
| 72 | {Value: 3}, |
| 73 | }}, |
| 74 | "/gopath/src/github.com/maruel/panicparse/stack/stack.go", |
nothing calls this directly
no test coverage detected
searching dependent graphs…