Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
improve test error messages in delay queue + FIFO
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed May 8, 2015
1 parent 6b0fec2 commit a2ab808
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/queue/delay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ func TestDQ_Offer(t *testing.T) {

added := dq.Offer(&testjob{})
if added {
t.Fatalf("offered job without deadline added")
t.Fatalf("DelayQueue should not add offered job without deadline")
}

deadline := time.Now().Add(delay)
added = dq.Offer(&testjob{deadline: &deadline})
if !added {
t.Fatalf("offered job with deadline not added")
t.Fatalf("DelayQueue should add offered job with deadline")
}

before := time.Now()
Expand Down Expand Up @@ -366,13 +366,13 @@ func TestDFIFO_Offer(t *testing.T) {

added := dq.Offer(&testjob{instance: 1}, ReplaceExisting)
if added {
t.Fatalf("offered job without deadline added")
t.Fatalf("DelayFIFO should not add offered job without deadline")
}

deadline := time.Now().Add(delay)
added = dq.Offer(&testjob{deadline: &deadline, instance: 2}, ReplaceExisting)
if !added {
t.Fatalf("offered job with deadline not added")
t.Fatalf("DelayFIFO should add offered job with deadline")
}

before := time.Now()
Expand Down

0 comments on commit a2ab808

Please sign in to comment.