(address string, timeout time.Duration)
| 495 | } |
| 496 | |
| 497 | func waitForServer(address string, timeout time.Duration) error { |
| 498 | start := time.Now() |
| 499 | for time.Since(start) < timeout { |
| 500 | if conn, err := grpc.NewClient(address, grpc.WithInsecure()); err == nil { |
| 501 | conn.Close() |
| 502 | return nil |
| 503 | } |
| 504 | time.Sleep(500 * time.Millisecond) |
| 505 | } |
| 506 | return fmt.Errorf("timeout waiting for server %s", address) |
| 507 | } |
| 508 | |
| 509 | func uploadTestData(data []byte, masterAddress string) (needle.VolumeId, error) { |
| 510 | // Upload data to get a file ID |
no test coverage detected