| 126 | } |
| 127 | |
| 128 | func waitForSentinel(ctx context.Context, t *testing.T, cmd *exec.Cmd, path string) { |
| 129 | t.Helper() |
| 130 | |
| 131 | ticker := time.NewTicker(testutil.IntervalFast) |
| 132 | defer ticker.Stop() |
| 133 | |
| 134 | // RequireEventually doesn't work well with require.NoError or similar require functions. |
| 135 | for { |
| 136 | err := cmd.Process.Signal(syscall.Signal(0)) |
| 137 | require.NoError(t, err) |
| 138 | |
| 139 | _, err = os.Stat(path) |
| 140 | if err == nil { |
| 141 | return |
| 142 | } |
| 143 | |
| 144 | select { |
| 145 | case <-ticker.C: |
| 146 | case <-ctx.Done(): |
| 147 | require.NoError(t, ctx.Err()) |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | func binCmd(ctx context.Context, t *testing.T, bin string, oom, nice int) (*exec.Cmd, string) { |
| 153 | var ( |