summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
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)
}