Comments (1)
Found workaround:
func BenchmarkGoroutines(b *testing.B) {
defer goleak.VerifyNone(
b,
goleak.IgnoreTopFunction("testing.(*B).run1"),
goleak.IgnoreTopFunction("testing.(*B).doBench"),
)
b.ResetTimer()
for i := 0; i < b.N; i++ {
wg := sync.WaitGroup{}
wg.Add(2)
go func() {
defer wg.Done()
}()
go func() {
defer wg.Done()
}()
wg.Wait()
}
}
from goleak.
Related Issues (20)
- [question]I'm literally confused about the result, why the test failed? HOT 2
- Is these function in testing package should be filtered in default? HOT 3
- goleak.IgnoreAnyFunction not working for rollbar-go
- default ignorelist entry for rules_go SIGTERM handler HOT 8
- Goleak detects leaked goroutines from other tests HOT 3
- Consider use of t.Cleanup in goleak
- Global way to ignore known leaks from a set of tests HOT 1
- 这个示例经测试,未能检测出泄漏 HOT 1
- fix security issue HOT 1
- support register teardown function in VerifyTestMain HOT 6
- Running tests with `-trace` is failing for new versions of go HOT 2
- Support tracebackancestors? HOT 1
- Friction for tinygo users
- goleak finds goroutine leak in not enabled test case HOT 4
- goleak is no longer compatible with Go 1.5+ HOT 2
- unexpected goroutines when `ReadAll(response.body)` - false positive? HOT 4
- Please drop unmaintained golang.org/x/lint dependency from go.mod HOT 1
- Make `maxRetries` and `maxSleep` configurable in goleak HOT 9
- create v1.2.1 release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goleak.