Skip to content

Commit

Permalink
fix goroutine leak check
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Apr 8, 2022
1 parent 2db728a commit 7c35efb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ RUN curl -L $golang > golang.tar.gz && \

ENV PATH="/usr/local/lib/.node/bin:/usr/local/lib/go/bin:/root/go/bin/:${PATH}"

ENV GODEBUG="tracebackancestors=1000"

# setup global git ignore
RUN git config --global core.excludesfile ~/.gitignore_global
2 changes: 1 addition & 1 deletion page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
func TestGetPageBrowser(t *testing.T) {
g := setup(t)

g.Equal(g.page.Browser(), g.browser)
g.Eq(g.page.Browser().BrowserContextID, g.browser.BrowserContextID)
}

func TestGetPageURL(t *testing.T) {
Expand Down
6 changes: 5 additions & 1 deletion setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ func (tp TesterPool) new() *G {

// get a tester
func (tp TesterPool) get(t *testing.T) G {
if got.Parallel() != 1 {
t.Parallel()
}

tester := <-tp.pool
if tester == nil {
tester = tp.new()
Expand Down Expand Up @@ -169,7 +173,7 @@ func (g G) newPage(u ...string) *rod.Page {
}

func (g G) checkLeaking() {
gotrace.CheckLeak(g.Testable, 0, gotrace.IgnoreCurrent())
gotrace.CheckLeak(g.Testable, 0, gotrace.IgnoreCurrent(), gotrace.IgnoreNonChildren())

g.Cleanup(func() {
if g.Failed() {
Expand Down

0 comments on commit 7c35efb

Please sign in to comment.