Skip to content

Commit

Permalink
Test (*WorkerPool).Len after Close
Browse files Browse the repository at this point in the history
Test that the returned length is 0 after closing the worker pool.

Signed-off-by: Tobias Klauser <[email protected]>
  • Loading branch information
tklauser authored and rolinh committed Mar 4, 2021
1 parent bc60e57 commit db8ad28
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions workerpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ func TestWorkerPoolLen(t *testing.T) {
if l := wp.Len(); l != 1 {
t.Errorf("got %d; want %d", l, 1)
}

if err := wp.Close(); err != nil {
t.Errorf("close: got '%v', want no error", err)
}
if l := wp.Len(); l != 0 {
t.Errorf("got %d; want %d", l, 0)
}
}

// TestWorkerPoolConcurrentTasksCount ensure that there is at least, but no
Expand Down

0 comments on commit db8ad28

Please sign in to comment.