fortytw2 / Leaktest
Licence: bsd-3-clause
Goroutine Leak Detector
Stars: β 872
Programming Languages
go
31211 projects - #10 most used programming language
Labels
Projects that are alternatives of or similar to Leaktest
noroutine
Goroutine analogue for Node.js, spreads I/O-bound routine calls to utilize thread pool (worker_threads) using balancer with event loop utilization. π±
Stars: β 86 (-90.14%)
Mutual labels: goroutine
gohive
π A Highly Performant and easy to use goroutine pool for Go
Stars: β 41 (-95.3%)
Mutual labels: goroutine
Goroutine Inspect
An interactive tool to analyze Golang goroutine dump.
Stars: β 272 (-68.81%)
Mutual labels: goroutine
goroutines
provides utilities to perform common tasks on goroutines
Stars: β 19 (-97.82%)
Mutual labels: goroutine
Golang runtime reading
golang 1.10.2 runtime code reading - golang runtimeζΊη εζγεͺζζθθΏοΌδ½ ζδΌε°θ±‘ζ·±ε»γ
Stars: β 393 (-54.93%)
Mutual labels: goroutine
chanbroker
ChanBroker, a Broker for goroutine, is simliar to kafka
Stars: β 61 (-93%)
Mutual labels: goroutine
retrygroup
Package retrygroup provides synchronization, Context cancelation for groups of retry goroutines working on subtasks of a common task.
Stars: β 18 (-97.94%)
Mutual labels: goroutine
ecs
Build your own Game-Engine based on the Entity Component System concept in Golang.
Stars: β 68 (-92.2%)
Mutual labels: goroutine
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: β 532 (-38.99%)
Mutual labels: goroutine
context
A proof of concept implementation of scoped context
Stars: β 16 (-98.17%)
Mutual labels: goroutine
cocoyaxi
A go-style coroutine library in C++11 and more.
Stars: β 2,392 (+174.31%)
Mutual labels: goroutine
Ants
πππ ants is a high-performance and low-cost goroutine pool in Go, inspired by fasthttp./ ants ζ―δΈδΈͺι«ζ§θ½δΈδ½ζθη goroutine ζ± γ
Stars: β 7,180 (+723.39%)
Mutual labels: goroutine
Machine
Machine is a zero dependency library for highly concurrent Go applications. It is inspired by errgroup.Group with extra bells & whistles
Stars: β 346 (-60.32%)
Mutual labels: goroutine
Leaktest
Refactored, tested variant of the goroutine leak detector found in both
net/http
tests and the cockroachdb
source tree.
Takes a snapshot of running goroutines at the start of a test, and at the end -
compares the two and voila. Ignores runtime/sys goroutines. Doesn't play nice
with t.Parallel()
right now, but there are plans to do so.
Installation
Go 1.7+
go get -u github.com/fortytw2/leaktest
Go 1.5/1.6 need to use the tag v1.0.0
, as newer versions depend on
context.Context
.
Example
These tests fail, because they leak a goroutine
// Default "Check" will poll for 5 seconds to check that all
// goroutines are cleaned up
func TestPool(t *testing.T) {
defer leaktest.Check(t)()
go func() {
for {
time.Sleep(time.Second)
}
}()
}
// Helper function to timeout after X duration
func TestPoolTimeout(t *testing.T) {
defer leaktest.CheckTimeout(t, time.Second)()
go func() {
for {
time.Sleep(time.Second)
}
}()
}
// Use Go 1.7+ context.Context for cancellation
func TestPoolContext(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
defer leaktest.CheckContext(ctx, t)()
go func() {
for {
time.Sleep(time.Second)
}
}()
}
LICENSE
Same BSD-style as Go, see LICENSE
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].