// TestHandleTask ensures that tasks are marked as done once handled.
TestHandleTask ensures that tasks are marked as done once handled.
// TestHandleTask ensures that tasks are marked as done once handled .
func TestHandleTask(t *testing.T) {
	hf := func(Task) Handler { return noopHandler{} }
	coord := NewTestCoord()
	c, _ := NewConsumer(coord, hf, DumbBalancer)
	go c.Run()
	coord.Tasks <- testTask{"task1"}
	select {
	case <-coord.Releases:
		t.Errorf("Release called, expected Done!")
	case <-coord.Dones:
	case <-time.After(100 * time.Millisecond):
		t.Fatalf("Took too long to mark task as done")
	}
	c.Shutdown()
}
func TestHandleTask ( t * testing . T ) { hf := func ( Task ) Handler { return noopHandler { } } coord := NewTestCoord ( ) c , _ := NewConsumer ( coord , hf , DumbBalancer ) go c . Run ( ) coord . Tasks <- testTask { " " } select { case <- coord . Releases : t . Errorf ( " " ) case <- coord . Dones : case <- time . After ( 100 * time . Millisecond ) : t . Fatalf ( " " ) } c . Shutdown ( ) }
TestHandleTask ensures that tasks are marked as done once handled.
TestHandleTask ensures that tasks are marked as done once handled .