diff options
author | Valery Piashchynski <[email protected]> | 2020-02-27 23:35:12 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-02-27 23:35:12 +0300 |
commit | 460075733def8bc46af867af4991ca5dff94a982 (patch) | |
tree | b00a6d49646f65dafd48d0fac8001c70c50f2410 /static_pool_test.go | |
parent | f11a2c4cdbacf2a6757607e551c75c190268ce97 (diff) |
Slightly refactor Test_StaticPool_AllocateTimeout test
Diffstat (limited to 'static_pool_test.go')
-rw-r--r-- | static_pool_test.go | 17 |
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) |