Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
issue 235: remove non-deterministic queue test
Browse files Browse the repository at this point in the history
  • Loading branch information
pittma committed Sep 8, 2015
1 parent 06e3d4d commit 6425e39
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions scheduler/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ func TestQueue(t *testing.T) {
So(q, ShouldHaveSameTypeAs, new(queue))
})

Convey("it receives jobs and adds them to queue", t, func() {
q := newQueue(5, func(job) { time.Sleep(1 * time.Second) })
q.Start()
q.Event <- &collectorJob{}
q.Event <- &collectorJob{}
time.Sleep(100 * time.Millisecond)
So(q.length(), ShouldEqual, 1)
q.Stop()
})

Convey("it pops items off and works them", t, func() {
x := 0
q := newQueue(5, func(job) { x = 1 })
Expand All @@ -45,7 +35,6 @@ func TestQueue(t *testing.T) {
q.Event <- j
}
time.Sleep(time.Millisecond * 10)
//So(x, ShouldResemble, []time.Duration{time.Duration(0), time.Duration(1 * time.Second), time.Duration(2 * time.Second), time.Duration(3 * time.Second)})
So(x[0].Unix(), ShouldBeLessThan, x[1].Unix())
So(x[1].Unix(), ShouldBeLessThan, x[2].Unix())
So(x[2].Unix(), ShouldBeLessThan, x[3].Unix())
Expand Down
2 changes: 1 addition & 1 deletion scheduler/work_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (mj *mockJob) ReplChan() chan struct{} { return mj.replchan }

func (mj *mockJob) Run() {
mj.worked = true
time.Sleep(time.Millisecond * 50)
time.Sleep(time.Millisecond * 100)
mj.replchan <- struct{}{}
}

Expand Down

0 comments on commit 6425e39

Please sign in to comment.