onsi / gomega

Ginkgo's Preferred Matcher Library
http://onsi.github.io/gomega/
MIT License
2.15k stars 282 forks source link

Gleak Suite fail with golang-1.21 #684

Closed mikelolasagasti closed 1 year ago

mikelolasagasti commented 1 year ago

Testing gomega 1.27.8 and 1.27.9 with golang-1.21-rc3 with the following error:

Running Suite: Gleak Suite - /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak
========================================================================================================
Random Seed: 1690190378

Will run 34 of 34 specs
••••••
------------------------------
• [FAILED] [0.000 seconds]
IgnoringCreator matcher [It] matches a creator function by full name
/builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/ignoring_creator_test.go:27

  [FAILED] creator Goroutine ID: 28, state: running, top function: github.com/onsi/gomega/gleak/goroutine.stacks, created by: github.com/onsi/gomega/gleak.creator in goroutine 27, at: /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/ignoring_creator_test.go:14
  Expected
      <bool>: false
  to be true
  In [It] at: /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/ignoring_creator_test.go:32 @ 07/24/23 11:19:38.161
------------------------------
••••••
------------------------------
• [FAILED] [2.001 seconds]
HaveLeaked [It] considers testing and runtime goroutines not to be leaks
/builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/have_leaked_matcher_test.go:77

  [FAILED] Timed out after 2.000s.
  should not find any leaks by default
  Expected not to leak 1 goroutines:
      goroutine 19 [select]
          github.com/onsi/ginkgo/v2/internal.RegisterForProgressSignal.func1() at internal/progress_report.go:32
          created by github.com/onsi/ginkgo/v2/internal.RegisterForProgressSignal in goroutine 6 at internal/progress_report.go:30
  In [It] at: /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/have_leaked_matcher_test.go:79 @ 07/24/23 11:19:40.162
------------------------------
• [FAILED] [2.002 seconds]
HaveLeaked when using signals [It] doesn't find leaks
/builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/have_leaked_matcher_test.go:84

  [FAILED] Timed out after 2.001s.
  found signal.Notify leaks
  Expected not to leak 1 goroutines:
      goroutine 19 [select]
          github.com/onsi/ginkgo/v2/internal.RegisterForProgressSignal.func1() at internal/progress_report.go:32
          created by github.com/onsi/ginkgo/v2/internal.RegisterForProgressSignal in goroutine 6 at internal/progress_report.go:30
  In [It] at: /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/have_leaked_matcher_test.go:88 @ 07/24/23 11:19:42.164
------------------------------
•••••••••••••••••••

Summarizing 3 Failures:
  [FAIL] IgnoringCreator matcher [It] matches a creator function by full name
  /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/ignoring_creator_test.go:32
  [FAIL] HaveLeaked [It] considers testing and runtime goroutines not to be leaks
  /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/have_leaked_matcher_test.go:79
  [FAIL] HaveLeaked when using signals [It] doesn't find leaks
  /builddir/build/BUILD/gomega-1.27.9/_build/src/github.com/onsi/gomega/gleak/have_leaked_matcher_test.go:88

Ran 34 of 34 Specs in 4.063 seconds
FAIL! -- 31 Passed | 3 Failed | 0 Pending | 0 Skipped

Fedora 39 will have golang-1.21 and this was detected by the continuous build system koschei:

https://koschei.fedoraproject.org/package/golang-github-onsi-gomega

thediveo commented 1 year ago

Thank you for reporting! Fixed on master and tested with go1.21rc2. Can you please give it a try?

mikelolasagasti commented 1 year ago

Tests are OK again with that patch. Thanks for this fast response!