Skip to content

Commit 02fa6d0

Browse files
committed
[tmp] debugging on CI
1 parent 40a5809 commit 02fa6d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/controller/controller_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ package controller_test
1818

1919
import (
2020
"fmt"
21+
"os"
2122
rt "runtime"
23+
"runtime/pprof"
2224

2325
. "github.com/onsi/ginkgo"
2426
. "github.com/onsi/gomega"
@@ -113,14 +115,16 @@ var _ = Describe("controller.Controller", func() {
113115

114116
It("should not create goroutines if never started", func() {
115117
startGoroutines := rt.NumGoroutine()
118+
Expect(pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)).To(Succeed())
116119

117120
m, err := manager.New(cfg, manager.Options{})
118121
Expect(err).NotTo(HaveOccurred())
119122

120123
_, err = controller.New("new-controller", m, controller.Options{Reconciler: rec})
121124
Expect(err).NotTo(HaveOccurred())
122125

123-
Expect(rt.NumGoroutine()).To(Equal(startGoroutines))
126+
Expect(pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)).To(Succeed())
127+
Eventually(rt.NumGoroutine /* pass func, don't call */).Should(Equal(startGoroutines))
124128
})
125129
})
126130
})

0 commit comments

Comments
 (0)