summaryrefslogtreecommitdiff
path: root/static_pool_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'static_pool_test.go')
-rw-r--r--static_pool_test.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/static_pool_test.go b/static_pool_test.go
index ccf69596..b264fa64 100644
--- a/static_pool_test.go
+++ b/static_pool_test.go
@@ -222,17 +222,22 @@ func Test_StaticPool_AllocateTimeout(t *testing.T) {
DestroyTimeout: time.Second,
},
)
-
- assert.NotNil(t, p)
- assert.NoError(t, err)
+ if err != nil {
+ t.Fatal(err)
+ }
done := make(chan interface{})
go func() {
- _, err := p.Exec(&Payload{Body: []byte("100")})
- assert.NoError(t, err)
- close(done)
+ if p != nil {
+ _, err := p.Exec(&Payload{Body: []byte("100")})
+ assert.NoError(t, err)
+ close(done)
+ } else {
+ t.Fatal("Pool is nil")
+ }
}()
+
// to ensure that worker is already busy
time.Sleep(time.Millisecond * 10)