summaryrefslogtreecommitdiff
path: root/sync_worker_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-27 00:35:15 +0300
committerValery Piashchynski <[email protected]>2020-11-27 00:35:15 +0300
commitfa9a7e319b5ac6d98fd18d1e4986de35fde254e5 (patch)
tree559908f3a491a15bb4926f79dbfde350ec7d4c40 /sync_worker_test.go
parent46ae5dcc22d971b0f909bce23ec8fdef26811ed6 (diff)
Add new pool event: EventNoFreeWorkers which indicates than RR can't get
worker from the stack during the allowed allocate timeout.
Diffstat (limited to 'sync_worker_test.go')
-rwxr-xr-xsync_worker_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/sync_worker_test.go b/sync_worker_test.go
index 69e6ece9..9786d709 100755
--- a/sync_worker_test.go
+++ b/sync_worker_test.go
@@ -70,7 +70,7 @@ func Test_BadPayload(t *testing.T) {
assert.Nil(t, res.Body)
assert.Nil(t, res.Context)
- assert.Equal(t, "payload can not be empty", err.Error())
+ assert.Contains(t, err.Error(), "payload can not be empty")
}
func Test_NotStarted_String(t *testing.T) {
@@ -98,7 +98,7 @@ func Test_NotStarted_Exec(t *testing.T) {
assert.Nil(t, res.Body)
assert.Nil(t, res.Context)
- assert.Equal(t, "WorkerProcess is not ready (inactive)", err.Error())
+ assert.Contains(t, err.Error(), "WorkerProcess is not ready (inactive)")
}
func Test_String(t *testing.T) {
@@ -215,10 +215,10 @@ func Test_Error(t *testing.T) {
assert.Nil(t, res.Body)
assert.Nil(t, res.Context)
- if errors.Is(errors.Exec, err) == false {
- t.Fatal("error should be of type errors.Exec")
+ if errors.Is(errors.ErrSoftJob, err) == false {
+ t.Fatal("error should be of type errors.ErrSoftJob")
}
- assert.Contains(t, err.Error(), "exec payload: Exec: hello")
+ assert.Contains(t, err.Error(), "exec payload: SoftJobError: hello")
}
func Test_NumExecs(t *testing.T) {