diff options
-rw-r--r-- | static_pool_test.go | 17 | ||||
-rw-r--r-- | worker_test.go | 2 |
2 files changed, 12 insertions, 7 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) diff --git a/worker_test.go b/worker_test.go index e8cbef90..c22b1db2 100644 --- a/worker_test.go +++ b/worker_test.go @@ -169,7 +169,7 @@ func Test_Broken(t *testing.T) { defer func() { err := w.Stop() - assert.Error(t, err) + assert.NoError(t, err) }() res, err := w.Exec(&Payload{Body: []byte("hello")}) |