...

Source file src/github.com/go-redis/redis/internal/pool/main_test.go

Documentation: github.com/go-redis/redis/internal/pool

     1  package pool_test
     2  
     3  import (
     4  	"net"
     5  	"sync"
     6  	"testing"
     7  
     8  	. "github.com/onsi/ginkgo"
     9  	. "github.com/onsi/gomega"
    10  )
    11  
    12  func TestGinkgoSuite(t *testing.T) {
    13  	RegisterFailHandler(Fail)
    14  	RunSpecs(t, "pool")
    15  }
    16  
    17  func perform(n int, cbs ...func(int)) {
    18  	var wg sync.WaitGroup
    19  	for _, cb := range cbs {
    20  		for i := 0; i < n; i++ {
    21  			wg.Add(1)
    22  			go func(cb func(int), i int) {
    23  				defer GinkgoRecover()
    24  				defer wg.Done()
    25  
    26  				cb(i)
    27  			}(cb, i)
    28  		}
    29  	}
    30  	wg.Wait()
    31  }
    32  
    33  func dummyDialer() (net.Conn, error) {
    34  	return &net.TCPConn{}, nil
    35  }
    36  

View as plain text