(path string, timeout time.Duration)
| 503 | } |
| 504 | |
| 505 | func waitForFile(path string, timeout time.Duration) error { |
| 506 | deadline := time.Now().Add(timeout) |
| 507 | for time.Now().Before(deadline) { |
| 508 | if _, err := os.Stat(path); err == nil { |
| 509 | return nil |
| 510 | } |
| 511 | time.Sleep(50 * time.Millisecond) |
| 512 | } |
| 513 | return fmt.Errorf("file did not appear: %s", path) |
| 514 | } |
| 515 | |
| 516 | func waitForFileContent(path string, needle string, timeout time.Duration) error { |
| 517 | deadline := time.Now().Add(timeout) |
no test coverage detected
searching dependent graphs…