diff --git a/debugd/debugd/deploy/download.go b/debugd/debugd/deploy/download.go index 7d916a164..80cbadb66 100644 --- a/debugd/debugd/deploy/download.go +++ b/debugd/debugd/deploy/download.go @@ -37,7 +37,7 @@ func (d *Download) DownloadCoordinator(ctx context.Context, ip string) error { serverAddr := net.JoinHostPort(ip, debugd.DebugdPort) // only retry download from same endpoint after backoff if lastAttempt, ok := d.attemptedDownloads[serverAddr]; ok && time.Since(lastAttempt) < debugd.CoordinatorDownloadRetryBackoff { - return nil + return fmt.Errorf("download failed too recently: %v / %v", time.Since(lastAttempt), debugd.CoordinatorDownloadRetryBackoff) } log.Printf("Trying to download coordinator from %s\n", ip) d.attemptedDownloads[serverAddr] = time.Now() diff --git a/debugd/debugd/deploy/download_test.go b/debugd/debugd/deploy/download_test.go index be74aa6d6..13c9579ac 100644 --- a/debugd/debugd/deploy/download_test.go +++ b/debugd/debugd/deploy/download_test.go @@ -52,10 +52,7 @@ func TestDownloadCoordinator(t *testing.T) { attemptedDownloads: map[string]time.Time{ "192.0.2.0:4000": time.Now(), }, - expectDownloadErr: false, - expectFile: false, - expectSystemdAction: false, - expectDeployed: false, + expectDownloadErr: true, }, "download rpc call error is detected": { server: fakeOnlyDownloadServer{