You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@FunkyGod Thanks for trying out Tunny! It looks like you're missing some code logic to wait for the goroutines to complete before Test_pools exits and calls pool.Close(). It's up to the user to ensure that the pool doesn't close before all these goroutines complete. Here's one way to do that (although you'll need to make sure that all the goroutines do complete after a finite amount of time):
`package goTest
import (
"fmt"
"github.com/Jeffail/tunny"
"strconv"
"testing"
"time"
)
func Test_pools(t *testing.T) {
}
func test1(i int){
fmt.Println("a"+strconv.Itoa(i))
}
`
problem
`GOROOT=/usr/local/Cellar/go/1.14.6/libexec #gosetup
GOPATH=/Users/gudaixin/go #gosetup
/usr/local/Cellar/go/1.14.6/libexec/bin/go test -c -o /private/var/folders/ty/2yjqwcmn1xv6d9v7blg39x0h0000gn/T/___Test_pools_in_ProjectGoModule_src_goTest ProjectGoModule/src/goTest #gosetup
/usr/local/Cellar/go/1.14.6/libexec/bin/go tool test2json -t /private/var/folders/ty/2yjqwcmn1xv6d9v7blg39x0h0000gn/T/___Test_pools_in_ProjectGoModule_src_goTest -test.v -test.run ^Test_pools$ #gosetup
=== RUN Test_pools
6
a6
7
a7
8
a8
9
a9
1
a1
panic: the pool is not running
goroutine 34 [running]:
github.com/Jeffail/tunny.(*Pool).Process(0xc0000a4640, 0x1114780, 0xc0000a61c0, 0xa9978700000000f, 0x61da5e0f)
/Users/gudaixin/go/pkg/mod/github.com/!jeffail/tunny@v0.1.4/tunny.go:158 +0x13d
created by ProjectGoModule/src/goTest.Test_pools
/Users/gudaixin/Public/PrivatePersonGoProject/ProjectGoModule/src/goTest/pool_test.go:21 +0xb1
Process finished with exit code 1
`
The text was updated successfully, but these errors were encountered: