(t *testing.T)
| 205 | } |
| 206 | |
| 207 | func TestAggregateDeadlockPanic(t *testing.T) { |
| 208 | t.Parallel() |
| 209 | // Test for crash found at https://github.com/maruel/panicparse/issues/56. |
| 210 | data := []string{ |
| 211 | "panic: deadlock detected at fmut", |
| 212 | "", |
| 213 | "goroutine 11 [select, 55 minutes]:", |
| 214 | "foo.Bar()", |
| 215 | " foo/foo.go:467 +0x2b8", |
| 216 | "foo.baz(0x3)", |
| 217 | " foo/foo.go:643 +0x69", |
| 218 | "created by main", |
| 219 | " foo/foo.go:631 +0x4b", |
| 220 | "", |
| 221 | "goroutine 52 [select, 55 minutes]:", |
| 222 | "foo.Bar()", |
| 223 | " foo/foo.go:467 +0x2b8", |
| 224 | "created by bozo", |
| 225 | " foo/foo.go:420 +0x33", |
| 226 | "", |
| 227 | "goroutine 55 [select, 55 minutes]:", |
| 228 | "foo.Bar()", |
| 229 | " foo/foo.go:467 +0x2b8", |
| 230 | "foo.baz(0x1)", |
| 231 | " foo/foo.go:643 +0x69", |
| 232 | "created by main", |
| 233 | " foo/foo.go:631 +0x4b", |
| 234 | } |
| 235 | s, suffix, err := ScanSnapshot(bytes.NewBufferString(strings.Join(data, "\n")), io.Discard, defaultOpts()) |
| 236 | if err != io.EOF { |
| 237 | t.Fatal(err) |
| 238 | } |
| 239 | if s == nil { |
| 240 | t.Fatal("expected snapshot") |
| 241 | } |
| 242 | want := []*Bucket{ |
| 243 | { |
| 244 | Signature: Signature{ |
| 245 | State: "select", |
| 246 | CreatedBy: Stack{Calls: []Call{ |
| 247 | { |
| 248 | Func: Func{Complete: "main", Name: "main"}, |
| 249 | RemoteSrcPath: "foo/foo.go", |
| 250 | Line: 631, |
| 251 | SrcName: "foo.go", |
| 252 | }, |
| 253 | }}, |
| 254 | SleepMin: 55, |
| 255 | SleepMax: 55, |
| 256 | Stack: Stack{ |
| 257 | Calls: []Call{ |
| 258 | { |
| 259 | Func: Func{ |
| 260 | Complete: "foo.Bar", |
| 261 | ImportPath: "foo", |
| 262 | DirName: "foo", |
| 263 | Name: "Bar", |
| 264 | IsExported: true, |
nothing calls this directly
no test coverage detected
searching dependent graphs…