diff options
author | Valery Piashchynski <[email protected]> | 2021-12-15 00:12:23 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-12-15 00:12:23 +0300 |
commit | b4e4f7e7e60bff48a63df4a3c606398ea2a32d8a (patch) | |
tree | d018a39795b94f61e1dadde54ce3382fc7e039b0 /pool/supervisor_test.go | |
parent | f2c79017ae5759256b03ec58b608f298a29e4b96 (diff) |
Update static_pool and worker to wait response from the worker
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pool/supervisor_test.go')
-rw-r--r-- | pool/supervisor_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pool/supervisor_test.go b/pool/supervisor_test.go index eb3c37dd..98af918a 100644 --- a/pool/supervisor_test.go +++ b/pool/supervisor_test.go @@ -211,18 +211,21 @@ func TestSupervisedPool_Idle(t *testing.T) { Body: []byte("foo"), }) - assert.Nil(t, err) + assert.NoError(t, err) assert.Empty(t, resp.Body) assert.Empty(t, resp.Context) time.Sleep(time.Second * 5) // worker should be marked as invalid and reallocated - _, err = p.Exec(&payload.Payload{ + rsp, err := p.Exec(&payload.Payload{ Context: []byte(""), Body: []byte("foo"), }) assert.NoError(t, err) + require.NotNil(t, rsp) + time.Sleep(time.Second * 2) + require.Len(t, p.Workers(), 1) // should be new worker with new pid assert.NotEqual(t, pid, p.Workers()[0].Pid()) p.Destroy(context.Background()) |