diff options
author | Valery Piashchynski <[email protected]> | 2021-01-18 22:38:45 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-01-18 22:38:45 +0300 |
commit | 4b17b4e3050be2f9caef749e7f05394d46815459 (patch) | |
tree | 787504dbb7b570f39c12af2913187175042b4bfd | |
parent | 6cbf6d78fe0a49475e5523a2bffe8996ecf8396e (diff) |
Update CI
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r-- | .github/workflows/build.yml | 2 | ||||
-rwxr-xr-x | pkg/pool/static_pool_test.go | 7 | ||||
-rw-r--r-- | pkg/pool/supervisor_test.go | 2 | ||||
-rw-r--r-- | pkg/worker_watcher/stack.go | 4 |
4 files changed, 7 insertions, 8 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index febf3e04..ca04b7ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: docker-compose -f ./tests/docker-compose.yaml down - name: Run golang tests on MacOS without codecov - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ matrix.os == 'macos-latest' }} run: | go test -v -race -tags=debug ./utils go test -v -race -tags=debug ./pkg/pipe diff --git a/pkg/pool/static_pool_test.go b/pkg/pool/static_pool_test.go index 53d6b191..f66895dc 100755 --- a/pkg/pool/static_pool_test.go +++ b/pkg/pool/static_pool_test.go @@ -459,16 +459,15 @@ func Test_Static_Pool_Handle_Dead(t *testing.T) { }, ) assert.NoError(t, err) - defer p.Destroy(ctx) - assert.NotNil(t, p) - for _, w := range p.Workers() { - w.State().Set(internal.StateErrored) + for i := range p.Workers() { + p.Workers()[i].State().Set(internal.StateErrored) } _, err = p.Exec(payload.Payload{Body: []byte("hello")}) assert.Error(t, err) + p.Destroy(ctx) } // identical to replace but controlled on worker side diff --git a/pkg/pool/supervisor_test.go b/pkg/pool/supervisor_test.go index 72226bee..b3358965 100644 --- a/pkg/pool/supervisor_test.go +++ b/pkg/pool/supervisor_test.go @@ -135,7 +135,6 @@ func TestSupervisedPool_Idle(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, p) - defer p.Destroy(context.Background()) pid := p.Workers()[0].Pid() @@ -151,6 +150,7 @@ func TestSupervisedPool_Idle(t *testing.T) { time.Sleep(time.Second * 5) // should be new worker with new pid assert.NotEqual(t, pid, p.Workers()[0].Pid()) + p.Destroy(context.Background()) } func TestSupervisedPool_ExecTTL_OK(t *testing.T) { diff --git a/pkg/worker_watcher/stack.go b/pkg/worker_watcher/stack.go index 788750dc..c87e8b65 100644 --- a/pkg/worker_watcher/stack.go +++ b/pkg/worker_watcher/stack.go @@ -109,7 +109,8 @@ func (stack *Stack) Destroy(ctx context.Context) { stack.destroy = true stack.mutex.Unlock() - tt := time.NewTicker(time.Millisecond * 100) + tt := time.NewTicker(time.Millisecond * 500) + defer tt.Stop() for { select { case <-tt.C: @@ -131,7 +132,6 @@ func (stack *Stack) Destroy(ctx context.Context) { _ = stack.workers[i].Kill() } stack.mutex.Unlock() - tt.Stop() // clear stack.Reset() return |