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

Commit

Permalink
Simplify test case for work manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorDoyle committed Dec 9, 2015
1 parent 717dffb commit 23d52d6
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions scheduler/work_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,11 @@ func TestWorkerManager(t *testing.T) {
j2 := newMockJob(false)
j3 := newMockJob(false)

// Rendez-vous when all jobs have been submitted to the work manager.
submitChan := make(chan struct{})

qjs := []queuedJob{}

// Submit three jobs.
go func() {
qjs = append(qjs, manager.Work(j1))
qjs = append(qjs, manager.Work(j2))
qjs = append(qjs, manager.Work(j3))

// Signal completion of the job submissions.
submitChan <- struct{}{}
}()

// Await job submissions.
<-submitChan
qjs := []queuedJob{}
qjs = append(qjs, manager.Work(j1))
qjs = append(qjs, manager.Work(j2))
qjs = append(qjs, manager.Work(j3))

// Await completion of j1 (also unblocking j1.Run()).
j1.Await()
Expand Down

0 comments on commit 23d52d6

Please sign in to comment.