dispatcher_test.go 292 B

12345678910111213141516171819202122
  1. package worker
  2. import (
  3. "context"
  4. "testing"
  5. "go.uber.org/goleak"
  6. )
  7. func TestDispatcher(t *testing.T) {
  8. defer goleak.VerifyNone(t)
  9. ctx := context.Background()
  10. jobChan := make(chan Job)
  11. d := NewDispatcher(10)
  12. err := d.Run(ctx, jobChan)
  13. if err != nil {
  14. panic(err)
  15. }
  16. d.Exit()
  17. }