(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestRunUtilSignal(t *testing.T) { |
| 39 | s := make(chan struct{}) |
| 40 | go func() { |
| 41 | RunUntilSignal() |
| 42 | s <- struct{}{} |
| 43 | close(s) |
| 44 | }() |
| 45 | |
| 46 | pid := os.Getpid() |
| 47 | testutil.Ok(t, runutil.Retry(200*time.Millisecond, context.Background().Done(), func() error { |
| 48 | testutil.Ok(t, syscall.Kill(pid, syscall.SIGHUP)) |
| 49 | select { |
| 50 | case <-s: |
| 51 | return nil |
| 52 | default: |
| 53 | return errors.New("execution is still stopped") |
| 54 | } |
| 55 | })) |
| 56 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…