Debian Codegraph @

gleak/goroutine/goroutine_test.go

raw symbols SCIP
1 package goroutinescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/
2
3 import (
4 "bufioscip-go gomod github.com/golang/go/src go1.24.0 bufio/"
5 "errorsscip-go gomod github.com/golang/go/src go1.24.0 errors/"
6 "ioscip-go gomod github.com/golang/go/src go1.24.0 io/"
7 "reflectscip-go gomod github.com/golang/go/src go1.24.0 reflect/"
8 "stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/"
9 "syncscip-go gomod github.com/golang/go/src go1.24.0 sync/"
10 "testing/iotestscip-go gomod github.com/golang/go/src go1.24.0 `testing/iotest`/"
11 "timescip-go gomod github.com/golang/go/src go1.24.0 time/"
12
13 . "github.com/onsi/ginkgo/v2scip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/"
14 . "github.com/onsi/gomegascip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/"
15 )
16
17 var _ = Describescip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/Describe().("goroutine", func() {
18
19 const stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack. = `runtime/debug.Stack()
20 /usr/local/go-faketime/src/runtime/debug/stack.go:24 +0x65
21 runtime/debug.PrintStack()
22 /usr/local/go-faketime/src/runtime/debug/stack.go:16 +0x19
23 main.main()
24 /tmp/sandbox3386995578/prog.go:10 +0x17
25 `
26 const headerscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:header. = `goroutine 666 [running]:
27 `
28 const nextStackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:nextStack. = headerscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:header. + `main.hades()
29 /tmp/sandbox3386995578/prog.go:10 +0x17
30 `
31
32 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("prints", func() {
33 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(Goroutinescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#{
34 IDscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#ID.: 1234,
35 Statescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#State.: "gone",
36 TopFunctionscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#TopFunction.: "gopher.hole",
37 }.Stringscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#String().()).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().(
38 "Goroutine ID: 1234, state: gone, top function: gopher.hole"))
39
40 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(Goroutinescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#{
41 IDscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#ID.: 1234,
42 Statescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#State.: "gone",
43 TopFunctionscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#TopFunction.: "gopher.hole",
44 CreatorFunctionscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#CreatorFunction.: "google",
45 BornAtscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#BornAt.: "/plan/10:2009",
46 }.Stringscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#String().()).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().(
47 "Goroutine ID: 1234, state: gone, top function: gopher.hole, created by: google, at: /plan/10:2009"))
48
49 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(Goroutinescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#{
50 IDscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#ID.: 1234,
51 Statescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#State.: "gone",
52 TopFunctionscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#TopFunction.: "gopher.hole",
53 CreatorFunctionscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#CreatorFunction.: "google",
54 BornAtscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#BornAt.: "/plan/10:2009",
55 }.GomegaStringscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#GomegaString().()).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().(
56 "{ID: 1234, State: \"gone\", TopFunction: \"gopher.hole\", CreatorFunction: \"google\", BornAt: \"/plan/10:2009\"}"))
57 })
58
59 Contextscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/Context.("goroutine header", func() {
60
61 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("parses goroutine header", func() {
62 g := newscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/new().(headerscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:header.)
63 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(g.IDscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#ID.).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().(uint64(666)))
64 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(g.Statescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#State.).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().("running"))
65 })
66
67 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("panics on malformed goroutine header", func() {
68 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(func() { _ = newscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/new().("a") }).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(PanicWithscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/PanicWith().(MatchRegexpscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/MatchRegexp().(`invalid stack header: .*`)))
69 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(func() { _ = newscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/new().("a b") }).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(PanicWithscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/PanicWith().(MatchRegexpscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/MatchRegexp().(`invalid stack header: .*`)))
70 })
71
72 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("panics on malformed goroutine ID", func() {
73 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(func() { _ = newscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/new().("a b c:\n") }).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(PanicWithscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/PanicWith().(MatchRegexpscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/MatchRegexp().(`invalid stack header ID: "b", header: ".*"`)))
74 })
75
76 })
77
78 Contextscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/Context.("goroutine backtrace", func() {
79
80 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("parses goroutine's backtrace", func() {
81 r := bufioscip-go gomod github.com/golang/go/src go1.24.0 bufio/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 bufio/NewReader().(stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 strings/NewReader().(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.))
82 topF, backtrace := parseGoroutineBacktracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseGoroutineBacktrace().(r)
83 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(topF).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().("runtime/debug.Stack"))
84 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(backtrace).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.))
85
86 r.Resetscip-go gomod github.com/golang/go/src go1.24.0 bufio/Reader#Reset().(stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 strings/NewReader().(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.[:len(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.)-1]))
87 topF, backtrace = parseGoroutineBacktracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseGoroutineBacktrace().(r)
88 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(topF).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().("runtime/debug.Stack"))
89 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(backtrace).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.[:len(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.)-1]))
90 })
91
92 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("parses goroutine's backtrace until next goroutine header", func() {
93 r := bufioscip-go gomod github.com/golang/go/src go1.24.0 bufio/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 bufio/NewReader().(stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 strings/NewReader().(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack. + nextStackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:nextStack.))
94 topF, backtrace := parseGoroutineBacktracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseGoroutineBacktrace().(r)
95 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(topF).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().("runtime/debug.Stack"))
96 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(backtrace).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().(stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.))
97 })
98
99 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("panics on invalid function call stack entry", func() {
100 r := bufioscip-go gomod github.com/golang/go/src go1.24.0 bufio/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 bufio/NewReader().(stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 strings/NewReader().(`main.main
101 /somewhere/prog.go:123 +0x666
102 `))
103 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(func() { parseGoroutineBacktracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseGoroutineBacktrace().(r) }).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(PanicWithscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/PanicWith().(MatchRegexpscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/MatchRegexp().(`invalid function call stack entry: "main.main"`)))
104 })
105
106 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("panics on failing reader", func() {
107 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(func() {
108 parseGoroutineBacktracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseGoroutineBacktrace().(bufioscip-go gomod github.com/golang/go/src go1.24.0 bufio/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 bufio/NewReader().(
109 iotestscip-go gomod github.com/golang/go/src go1.24.0 `testing/iotest`/.ErrReaderscip-go gomod github.com/golang/go/src go1.24.0 `testing/iotest`/ErrReader().(errorsscip-go gomod github.com/golang/go/src go1.24.0 errors/.Newscip-go gomod github.com/golang/go/src go1.24.0 errors/New().("foo failure"))))
110 }).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(PanicWithscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/PanicWith().("parsing backtrace failed: foo failure"))
111
112 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(func() {
113 parseGoroutineBacktracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseGoroutineBacktrace().(
114 bufioscip-go gomod github.com/golang/go/src go1.24.0 bufio/.NewReaderSizescip-go gomod github.com/golang/go/src go1.24.0 bufio/NewReaderSize().(
115 iotestscip-go gomod github.com/golang/go/src go1.24.0 `testing/iotest`/.TimeoutReaderscip-go gomod github.com/golang/go/src go1.24.0 `testing/iotest`/TimeoutReader().(stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 strings/NewReader().(stringsscip-go gomod github.com/golang/go/src go1.24.0 strings/.Repeatscip-go gomod github.com/golang/go/src go1.24.0 strings/Repeat().("x", 32))),
116 16))
117 }).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(PanicWithscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/PanicWith().("parsing backtrace failed: timeout"))
118
119 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(func() {
120 parseGoroutineBacktracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseGoroutineBacktrace().(bufioscip-go gomod github.com/golang/go/src go1.24.0 bufio/.NewReaderscip-go gomod github.com/golang/go/src go1.24.0 bufio/NewReader().(
121 iotestscip-go gomod github.com/golang/go/src go1.24.0 `testing/iotest`/.ErrReaderscip-go gomod github.com/golang/go/src go1.24.0 `testing/iotest`/ErrReader().(ioscip-go gomod github.com/golang/go/src go1.24.0 io/.ErrClosedPipescip-go gomod github.com/golang/go/src go1.24.0 io/ErrClosedPipe.)))
122 }).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(PanicWithscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/PanicWith().(MatchRegexpscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/MatchRegexp().(`parsing backtrace failed: .*`)))
123 })
124
125 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("parses goroutine information and stack", func() {
126 gs := parseStackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/parseStack().([]byte(headerscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:header. + stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.))
127 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(gs).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(HaveLenscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveLen().(1))
128 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(gs[0]).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Andscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/And().(
129 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("ID", uint64(666)),
130 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("State", "running"),
131 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("TopFunction", "runtime/debug.Stack"),
132 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("Backtrace", stackscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/_:stack.)))
133 })
134
135 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("finds its Creator", func() {
136 creator, location := findCreatorscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/findCreator().(`
137 goroutine 42 [chan receive]:
138 main.foo.func1()
139 /home/foo/test.go:6 +0x28
140 created by main.foo
141 /home/foo/test.go:5 +0x64
142 `)
143 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(creator).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().("main.foo"))
144 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(location).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Equalscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Equal().("/home/foo/test.go:5"))
145 })
146
147 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("handles missing or invalid creator information", func() {
148 creator, location := findCreatorscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/findCreator().("")
149 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(creator).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
150 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(location).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
151
152 creator, location = findCreatorscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/findCreator().(`
153 goroutine 42 [chan receive]:
154 main.foo.func1()
155 /home/foo/test.go:6 +0x28
156 created by`)
157 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(creator).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
158 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(location).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
159
160 creator, location = findCreatorscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/findCreator().(`
161 goroutine 42 [chan receive]:
162 main.foo.func1()
163 /home/foo/test.go:6 +0x28
164 created by main.foo`)
165 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(creator).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
166 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(location).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
167
168 creator, location = findCreatorscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/findCreator().(`
169 goroutine 42 [chan receive]:
170 main.foo.func1()
171 /home/foo/test.go:6 +0x28
172 created by main.foo
173 /home/foo/test.go:5
174 `)
175 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(creator).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
176 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(location).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
177 })
178
179 })
180
181 Contextscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/Context.("live", func() {
182
183 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("discovers current goroutine information", func() {
184 type T struct{}
185 pkg := reflectscip-go gomod github.com/golang/go/src go1.24.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.24.0 reflect/TypeOf().(T{}).PkgPathscip-go gomod github.com/golang/go/src go1.24.0 reflect/Type#PkgPath().()
186 gs := goroutinesscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/goroutines().(false)
187 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(gs).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(HaveLenscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveLen().(1))
188 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(gs[0]).Toscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#To.(Andscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/And().(
189 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("ID", Notscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Not().(BeZeroscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeZero().())),
190 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("State", "running"),
191 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("TopFunction", pkg+".stacks"),
192 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("Backtrace", MatchRegexpscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/MatchRegexp().(pkg+`.stacks.*
193 `))))
194 })
195
196 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("discovers a goroutine's creator", func() {
197 ch := make(chan Goroutinescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#)
198 go func() {
199 ch <- Currentscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Current().()
200 }()
201 g := <-ch
202 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(g.CreatorFunctionscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#CreatorFunction.).NotToscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#NotTo.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().(), "no creator: %s", g.Backtracescip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#Backtrace.)
203 Expectscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Expect().(g.BornAtscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutine#BornAt.).NotToscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/Assertion#NotTo.(BeEmptyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/BeEmpty().())
204 })
205
206 Itscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/It().("discovers all goroutine information", func() {
207 Byscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/By().("creating a chan receive canary goroutine")
208 done := make(chan struct{})
209 go testWaitscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/testWait().(done)
210 once := syncscip-go gomod github.com/golang/go/src go1.24.0 sync/.Oncescip-go gomod github.com/golang/go/src go1.24.0 sync/Once#{}
211 cloze := func() { once.Doscip-go gomod github.com/golang/go/src go1.24.0 sync/Once#Do().(func() { close(done) }) }
212 defer cloze()
213
214 Byscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/By().("getting all goroutines including canary")
215 type T struct{}
216 pkg := reflectscip-go gomod github.com/golang/go/src go1.24.0 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.24.0 reflect/TypeOf().(T{}).PkgPathscip-go gomod github.com/golang/go/src go1.24.0 reflect/Type#PkgPath().()
217 Eventuallyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Eventually().(Goroutinesscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutines().).
218 WithTimeoutscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/AsyncAssertion#WithTimeout.(1 * timescip-go gomod github.com/golang/go/src go1.24.0 time/.Secondscip-go gomod github.com/golang/go/src go1.24.0 time/Second.).WithPollingscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/AsyncAssertion#WithPolling.(250 * timescip-go gomod github.com/golang/go/src go1.24.0 time/.Millisecondscip-go gomod github.com/golang/go/src go1.24.0 time/Millisecond.).
219 Shouldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/AsyncAssertion#Should.(ContainElementsscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/ContainElements().(
220 Andscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/And().(
221 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("TopFunction", pkg+".stacks"),
222 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("State", "running")),
223 Andscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/And().(
224 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("TopFunction", pkg+".testWait"),
225 HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("State", "chan receive")),
226 ))
227
228 Byscip-go gomod github.com/onsi/ginkgo/v2 v2.28.0 `github.com/onsi/ginkgo/v2`/By().("getting all goroutines after being done with the canary")
229 cloze()
230 Eventuallyscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/Eventually().(Goroutinesscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/Goroutines().).
231 WithTimeoutscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/AsyncAssertion#WithTimeout.(1 * timescip-go gomod github.com/golang/go/src go1.24.0 time/.Secondscip-go gomod github.com/golang/go/src go1.24.0 time/Second.).WithPollingscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/AsyncAssertion#WithPolling.(250 * timescip-go gomod github.com/golang/go/src go1.24.0 time/.Millisecondscip-go gomod github.com/golang/go/src go1.24.0 time/Millisecond.).
232 ShouldNotscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/types`/AsyncAssertion#ShouldNot.(ContainElementscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/ContainElement().(HaveFieldscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega`/HaveField().("TopFunction", pkg+".testWait")))
233 })
234
235 })
236
237 })
238
239 func testWaitscip-go gomod github.com/onsi/gomega . `github.com/onsi/gomega/gleak/goroutine`/testWait().(done <-chan struct{}) {
240 <-done
241 }