From 8cdac2daf2fc4a1a95ddebca585f4ec38beff210 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Fri, 13 Aug 2021 02:38:15 +0300 Subject: Update go.mod dependencies to the most recent version. Fix tests according to the new mocks. Signed-off-by: Valery Piashchynski --- pkg/events/jobs_events.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'pkg') diff --git a/pkg/events/jobs_events.go b/pkg/events/jobs_events.go index c0ee733a..300f6748 100644 --- a/pkg/events/jobs_events.go +++ b/pkg/events/jobs_events.go @@ -20,9 +20,6 @@ const ( // EventJobError thrown on all job related errors. See JobError as context. EventJobError - // EventInitialized when pipeline has been initialized, but not started - EventInitialized - // EventPipeActive when pipeline has started. EventPipeActive @@ -53,8 +50,6 @@ func (ev J) String() string { return "EventJobOK" case EventJobError: return "EventJobError" - case EventInitialized: - return "EventInitialized" case EventPipeActive: return "EventPipeActive" case EventPipeStopped: -- cgit v1.2.3 From e17bb65ae70c47020eb40a798cf49f6e98ef3d5f Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Fri, 13 Aug 2021 10:51:23 +0300 Subject: Add timeout to the Test_Tcp_StartError test Signed-off-by: Valery Piashchynski --- pkg/transport/socket/socket_factory_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/transport/socket/socket_factory_test.go b/pkg/transport/socket/socket_factory_test.go index f9bb2178..17437e2f 100755 --- a/pkg/transport/socket/socket_factory_test.go +++ b/pkg/transport/socket/socket_factory_test.go @@ -78,7 +78,9 @@ func Test_Tcp_StartCloseFactory(t *testing.T) { func Test_Tcp_StartError(t *testing.T) { time.Sleep(time.Millisecond * 10) // to ensure free socket - ctx := context.Background() + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + ls, err := net.Listen("tcp", "127.0.0.1:9007") if assert.NoError(t, err) { defer func() { @@ -97,7 +99,9 @@ func Test_Tcp_StartError(t *testing.T) { t.Errorf("error executing the command: error %v", err) } - w, err := NewSocketServer(ls, time.Minute).SpawnWorkerWithTimeout(ctx, cmd) + serv := NewSocketServer(ls, time.Minute) + time.Sleep(time.Second * 2) + w, err := serv.SpawnWorkerWithTimeout(ctx, cmd) assert.Error(t, err) assert.Nil(t, w) } -- cgit v1.2.3 From e85855df8dffa82efdbaf8592701caf5512fb26b Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Fri, 13 Aug 2021 11:05:02 +0300 Subject: Add sleep timeout to the Test_StaticPool_JobError Signed-off-by: Valery Piashchynski --- pkg/pool/static_pool_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/pool/static_pool_test.go b/pkg/pool/static_pool_test.go index 2ac2093d..b72b8c32 100755 --- a/pkg/pool/static_pool_test.go +++ b/pkg/pool/static_pool_test.go @@ -151,8 +151,9 @@ func Test_StaticPool_JobError(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, p) - res, err := p.Exec(&payload.Payload{Body: []byte("hello")}) + time.Sleep(time.Second * 2) + res, err := p.Exec(&payload.Payload{Body: []byte("hello")}) assert.Error(t, err) assert.Nil(t, res) -- cgit v1.2.3