Skip to content

Commit 702aa20

Browse files
kalbhorLakshay Kalbhor
and
Lakshay Kalbhor
authored
fix: separate job_id for group tests to avoid race (#43)
Co-authored-by: Lakshay Kalbhor <[email protected]>
1 parent 9be7446 commit 702aa20

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

client/client_test.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ var (
2727
Queue: "test",
2828
Retries: 3,
2929
}}
30+
group = models.GroupReq{
31+
GroupID: "testgroup",
32+
Jobs: []models.JobReq{
33+
{
34+
JobID: "job1_group",
35+
TaskName: "get_profit_summary",
36+
Queue: "test",
37+
Retries: 4,
38+
}, {
39+
JobID: "job2_group",
40+
TaskName: "get_profit_summary",
41+
Queue: "test",
42+
Retries: 3,
43+
}},
44+
}
3045

3146
jobsPending = []models.JobReq{{
3247
JobID: "job3",
@@ -146,13 +161,10 @@ func TestDeleteJob(t *testing.T) {
146161
}
147162

148163
func TestPostJobGroup(t *testing.T) {
149-
_, err := cl.PostJobGroup(models.GroupReq{
150-
GroupID: "testgroup",
151-
Jobs: jobs,
152-
})
164+
_, err := cl.PostJobGroup(group)
153165
assert.NoError(t, err, "error posting job group")
154166
}
155167
func TestGetJobGroupStatus(t *testing.T) {
156-
_, err := cl.GetGroupStatus("testgroup")
168+
_, err := cl.GetGroupStatus(group.GroupID)
157169
assert.NoError(t, err, "error getting job group status")
158170
}

0 commit comments

Comments
 (0)