Skip to content

Commit

Permalink
Add more time for the checks (#1516)
Browse files Browse the repository at this point in the history
* Add more time for the checks
On the prow clusters which are usually strapped for CPU this fails due to wrong order of things

* harden
  • Loading branch information
vagababov authored Jul 17, 2020
1 parent 931d121 commit 25be382
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controller/two_lane_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func TestDoubleKey(t *testing.T) {
// Verifies that we don't get double concurrent processing of the same key.
q := newTwoLaneWorkQueue("live-in-the-fast-lane")
q.Add("1")
q.SlowLane().Add("1")
t.Cleanup(q.ShutDown)

k, done := q.Get()
Expand All @@ -60,6 +59,8 @@ func TestDoubleKey(t *testing.T) {
t.Error("The queue is unexpectedly shutdown")
}

// This should not be read from the queue until we actually call `Done`.
q.SlowLane().Add("1")
sentinel := make(chan struct{})
go func() {
defer close(sentinel)
Expand All @@ -75,7 +76,7 @@ func TestDoubleKey(t *testing.T) {
select {
case <-sentinel:
t.Error("The sentinel should not have fired")
case <-time.After(200 * time.Millisecond):
case <-time.After(600 * time.Millisecond):
// Expected.
}
// This should permit the re-reading of the same key.
Expand Down

0 comments on commit 25be382

Please sign in to comment.