Skip to content

Commit

Permalink
fix: separate job_id for group tests to avoid race (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: Lakshay Kalbhor <[email protected]>
  • Loading branch information
kalbhor and Lakshay Kalbhor authored Jul 5, 2024
1 parent 9be7446 commit 702aa20
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ var (
Queue: "test",
Retries: 3,
}}
group = models.GroupReq{
GroupID: "testgroup",
Jobs: []models.JobReq{
{
JobID: "job1_group",
TaskName: "get_profit_summary",
Queue: "test",
Retries: 4,
}, {
JobID: "job2_group",
TaskName: "get_profit_summary",
Queue: "test",
Retries: 3,
}},
}

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

func TestPostJobGroup(t *testing.T) {
_, err := cl.PostJobGroup(models.GroupReq{
GroupID: "testgroup",
Jobs: jobs,
})
_, err := cl.PostJobGroup(group)
assert.NoError(t, err, "error posting job group")
}
func TestGetJobGroupStatus(t *testing.T) {
_, err := cl.GetGroupStatus("testgroup")
_, err := cl.GetGroupStatus(group.GroupID)
assert.NoError(t, err, "error getting job group status")
}

0 comments on commit 702aa20

Please sign in to comment.