You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert.Equal(t, http.StatusConflict, secondResponseRecorder.Code, "Response status code should be 409 Conflict")
63
58
assert.Equal(t, fmt.Sprintf("Error when executing the task: %s", task.ErrAlreadyExists), secondResponseRecorder.Body.String(), "Response body should contain error message")
64
-
assert.Equal(t, 1, len(api.Worker.Tasks), "Tasks map should contain 1 task")
65
-
assert.NotNil(t, api.Worker.Tasks[testTask.ID], "Persisted task ID should match the one from request")
59
+
assert.Equal(t, 1, api.Worker.LenTasks(), "Tasks map should contain 1 task")
60
+
assert.NotNil(t, api.Worker.GetTask(testTask.ID), "Persisted task ID should match the one from request")
assert.Equal(t, 499, createResponseRecorder.Code, "Response status code should be 499 Client Closed Request")
134
125
assert.Equal(t, "Error when executing the task: client closed request", createResponseRecorder.Body.String(), "Response body should contain error message")
135
126
assert.NotEmpty(t, stdout, "Task logs shouldn't be empty")
136
-
assert.Empty(t, api.Worker.Tasks, "Tasks map should be empty")
127
+
assert.Zero(t, api.Worker.LenTasks(), "Tasks map should be empty")
137
128
}()
138
129
139
130
time.Sleep(1*time.Second)
140
131
141
-
assert.Equal(t, 1, len(api.Worker.Tasks), "Tasks map should contain 1 task")
132
+
assert.Equal(t, 1, api.Worker.LenTasks(), "Tasks map should contain 1 task")
assert.Equal(t, http.StatusInternalServerError, createResponseRecorder.Code, "Response status code should be 500 Internal Server Error")
79
75
assert.Equal(t, fmt.Sprintf("Error when executing the task: %s", helper.SignalKilledErrMessage), createResponseRecorder.Body.String(), "Response body should contain error message")
80
-
assert.Empty(t, api.Worker.Tasks, "Tasks map should be empty")
76
+
assert.Zero(t, api.Worker.LenTasks(), "Tasks map should be empty")
81
77
}()
82
78
83
79
time.Sleep(1*time.Second)
84
80
85
-
assert.Equal(t, 1, len(api.Worker.Tasks), "Tasks map should contain 1 task")
81
+
assert.Equal(t, 1, api.Worker.LenTasks(), "Tasks map should contain 1 task")
0 commit comments