(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestServiceFailureWatcher(t *testing.T) { |
| 41 | w := NewFailureWatcher() |
| 42 | |
| 43 | err := errors.New("this error doesn't end with dot") |
| 44 | |
| 45 | failing := NewBasicService(nil, nil, func(_ error) error { |
| 46 | return err |
| 47 | }) |
| 48 | |
| 49 | w.WatchService(failing) |
| 50 | |
| 51 | require.NoError(t, failing.StartAsync(context.Background())) |
| 52 | |
| 53 | e := <-w.Chan() |
| 54 | require.NotNil(t, e) |
| 55 | require.Equal(t, err, e2.Cause(e)) |
| 56 | } |
| 57 | |
| 58 | func TestServiceFailureWatcherClose(t *testing.T) { |
| 59 | s1 := serviceThatDoesntDoAnything() |
nothing calls this directly
no test coverage detected