(substr string, timeout time.Duration)
| 235 | |
| 236 | func (h *cpHarness) waitForLog(substr string, timeout time.Duration) error { |
| 237 | deadline := time.Now().Add(timeout) |
| 238 | for time.Now().Before(deadline) { |
| 239 | if strings.Contains(h.logBuf.String(), substr) { |
| 240 | return nil |
| 241 | } |
| 242 | time.Sleep(100 * time.Millisecond) |
| 243 | } |
| 244 | return fmt.Errorf("log %q not found after %v", substr, timeout) |
| 245 | } |
| 246 | |
| 247 | func (h *cpHarness) cleanup(t *testing.T) { |
| 248 | t.Helper() |
| 249 | defer func() { |
no test coverage detected