summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-13 22:15:21 +0300
committerGitHub <[email protected]>2021-08-13 22:15:21 +0300
commit6860326fa5d8f37f6e954da07fd53b9261731227 (patch)
treebb5fe7dde56edb1e8c3b55a21a874bbbaeda3a3b /pkg
parentde378e7698db896b8fd16f628c7d89689c8371d0 (diff)
parent849b20c354faf81f2bcf101fba025ae425e33e85 (diff)
#762: fix(tests): update gomock with tests, update all deps in the `go.mod`
#762: fix(tests): update gomock with tests, update all deps in the `go.mod`
Diffstat (limited to 'pkg')
-rw-r--r--pkg/events/jobs_events.go5
-rwxr-xr-xpkg/pool/static_pool_test.go3
-rwxr-xr-xpkg/transport/socket/socket_factory_test.go8
3 files changed, 8 insertions, 8 deletions
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:
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)
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)
}