diff options
Diffstat (limited to 'internal/queue/queue_test.go')
| -rw-r--r-- | internal/queue/queue_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/queue/queue_test.go b/internal/queue/queue_test.go index 3933325b..429e8017 100644 --- a/internal/queue/queue_test.go +++ b/internal/queue/queue_test.go @@ -12,18 +12,18 @@ import ( func TestNewTaskID(t *testing.T) { // Verify that the task ID is the same within taskIDChangeInterval and changes // afterwards. - const ( - module = "mod" - version = "ver" + var ( + module = "mod" + version = "ver" + taskIDChangeInterval = 3 * time.Hour ) - tm := time.Now().Truncate(taskIDChangeInterval) - id1 := newTaskID(module, version, tm) - id2 := newTaskID(module, version, tm.Add(taskIDChangeInterval/2)) + id1 := newTaskID(module, version, tm, taskIDChangeInterval) + id2 := newTaskID(module, version, tm.Add(taskIDChangeInterval/2), taskIDChangeInterval) if id1 != id2 { t.Error("wanted same task ID, got different") } - id3 := newTaskID(module, version, tm.Add(taskIDChangeInterval+1)) + id3 := newTaskID(module, version, tm.Add(taskIDChangeInterval+1), taskIDChangeInterval) if id1 == id3 { t.Error("wanted different task ID, got same") } |
