redis/internal/pool/main_test.go

37 lines
550 B
Go
Raw Normal View History

2016-03-17 14:48:04 +03:00
package pool_test
import (
2019-06-04 14:05:29 +03:00
"context"
2016-03-17 14:48:04 +03:00
"net"
"sync"
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
func TestGinkgoSuite(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "pool")
}
func perform(n int, cbs ...func(int)) {
var wg sync.WaitGroup
for _, cb := range cbs {
for i := 0; i < n; i++ {
wg.Add(1)
go func(cb func(int), i int) {
defer GinkgoRecover()
defer wg.Done()
cb(i)
}(cb, i)
}
}
wg.Wait()
}
2019-06-04 14:05:29 +03:00
func dummyDialer(context.Context) (net.Conn, error) {
return &net.TCPConn{}, nil
2016-03-17 14:48:04 +03:00
}