@@ -246,6 +246,7 @@ func TestListJobs(t *testing.T) {
246246}
247247expectedJobs := make ([]db.Job ,len (jobs ))
248248for i ,job := range jobs {
249+ job := job
249250err = repo .CreateJob (& job )
250251if err != nil {
251252t .Fatal (err )
@@ -297,6 +298,7 @@ func TestListJobsLimit(t *testing.T) {
297298limit := 2
298299expectedJobs := make ([]db.Job ,limit )
299300for i ,job := range jobs {
301+ job := job
300302err = repo .CreateJob (& job )
301303if err != nil {
302304t .Fatal (err )
@@ -352,6 +354,7 @@ func TestListJobsInconsistency(t *testing.T) {
352354redisRepo .storage .RedisClient ().ZAddNX ("some-weird-id2" , redis.Z {Member :jobs [1 ],Score :math .Inf (0 )})
353355expectedJobs := make ([]db.Job ,len (jobs ))
354356for i ,job := range jobs {
357+ job := job
355358err = repo .CreateJob (& job )
356359if err != nil {
357360t .Fatal (err )
@@ -409,6 +412,7 @@ func TestListJobsFiltering(t *testing.T) {
409412since := now .Add (- 59 * time .Minute )
410413redisRepo := repo .(* redisRepository )
411414for _ ,job := range jobs {
415+ job := job
412416err = redisRepo .saveJob (& job )
413417if err != nil {
414418t .Fatal (err )
@@ -469,6 +473,7 @@ func TestListJobsFilteringAndLimit(t *testing.T) {
469473since := now .Add (- 59 * time .Minute )
470474redisRepo := repo .(* redisRepository )
471475for _ ,job := range jobs {
476+ job := job
472477err = redisRepo .saveJob (& job )
473478if err != nil {
474479t .Fatal (err )