diff options
author | Martin Polden <mpolden@mpolden.no> | 2024-06-10 13:11:50 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2024-06-10 13:47:01 +0200 |
commit | d9743d9edce44b1858e08ff26d3e4b93f67b13e6 (patch) | |
tree | a33539aafcec9ae1656ee89ea6aa337ff8dbe12d | |
parent | f9796bf5213afa8e1ffef75d264563f8a7fcfbcd (diff) |
Improve wait error messages
-rw-r--r-- | client/go/internal/cli/cmd/deploy_test.go | 2 | ||||
-rw-r--r-- | client/go/internal/cli/cmd/status_test.go | 8 | ||||
-rw-r--r-- | client/go/internal/vespa/target.go | 2 | ||||
-rw-r--r-- | client/go/internal/vespa/target_cloud.go | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/client/go/internal/cli/cmd/deploy_test.go b/client/go/internal/cli/cmd/deploy_test.go index 00d540abdda..4771d107ba4 100644 --- a/client/go/internal/cli/cmd/deploy_test.go +++ b/client/go/internal/cli/cmd/deploy_test.go @@ -89,7 +89,7 @@ func TestDeployCloudFastWait(t *testing.T) { httpClient.NextResponseString(200, `ok`) httpClient.NextResponseString(200, `{"active": false, "status": "unsuccesful"}`) require.NotNil(t, cli.Run("deploy", pkgDir)) - assert.Equal(t, stderr.String(), "Error: deployment run 0 incomplete after waiting up to 2s: aborting wait: deployment failed: run 0 ended with unsuccessful status: unsuccesful\n") + assert.Equal(t, stderr.String(), "Error: deployment run 0 not yet complete after waiting up to 2s: aborting wait: deployment failed: run 0 ended with unsuccessful status: unsuccesful\n") assert.True(t, httpClient.Consumed()) // Deployment which is running does not return error diff --git a/client/go/internal/cli/cmd/status_test.go b/client/go/internal/cli/cmd/status_test.go index 80afd79e296..bf9b4f3493e 100644 --- a/client/go/internal/cli/cmd/status_test.go +++ b/client/go/internal/cli/cmd/status_test.go @@ -85,7 +85,7 @@ func TestStatusError(t *testing.T) { cli.httpClient = client assert.NotNil(t, cli.Run("status", "container")) assert.Equal(t, - "Container default at http://127.0.0.1:8080 is not ready: unhealthy container default: status 500 at http://127.0.0.1:8080/status.html: giving up\n", + "Container default at http://127.0.0.1:8080 is not ready: unhealthy container default: status 500 at http://127.0.0.1:8080/status.html: wait deadline reached\n", stdout.String()) assert.Equal(t, "Error: services not ready: default\n", @@ -122,13 +122,13 @@ func TestStatusLocalDeployment(t *testing.T) { resp.Body = []byte(`{"currentGeneration": 42, "converged": false}`) client.NextResponse(resp) assert.NotNil(t, cli.Run("status", "deployment")) - assert.Equal(t, "Warning: deployment not converged on latest generation: giving up\nHint: Consider using the --wait flag to wait for completion\n", stderr.String()) + assert.Equal(t, "Warning: deployment not converged on latest generation: wait deadline reached\nHint: Consider using the --wait flag to wait for completion\n", stderr.String()) // Explicit generation stderr.Reset() client.NextResponse(resp) assert.NotNil(t, cli.Run("status", "deployment", "41")) - assert.Equal(t, "Warning: deployment not converged on generation 41: giving up\nHint: Consider using the --wait flag to wait for completion\n", stderr.String()) + assert.Equal(t, "Warning: deployment not converged on generation 41: wait deadline reached\nHint: Consider using the --wait flag to wait for completion\n", stderr.String()) } func TestStatusCloudDeployment(t *testing.T) { @@ -164,7 +164,7 @@ func TestStatusCloudDeployment(t *testing.T) { Body: []byte(`{"active": false, "status": "failure"}`), }) assert.NotNil(t, cli.Run("status", "deployment", "42", "-w", "10")) - assert.Equal(t, "Waiting up to 10s for deployment to converge...\nWarning: deployment run 42 incomplete after waiting up to 10s: aborting wait: deployment failed: run 42 ended with unsuccessful status: failure\n", stderr.String()) + assert.Equal(t, "Waiting up to 10s for deployment to converge...\nWarning: deployment run 42 not yet complete after waiting up to 10s: aborting wait: deployment failed: run 42 ended with unsuccessful status: failure\n", stderr.String()) } func isLocalTarget(args []string) bool { diff --git a/client/go/internal/vespa/target.go b/client/go/internal/vespa/target.go index a35d8dd0741..960917b75d6 100644 --- a/client/go/internal/vespa/target.go +++ b/client/go/internal/vespa/target.go @@ -40,7 +40,7 @@ var errAuth = errors.New("auth failed") var ( // ErrWaitTimeout is the error returned when waiting for something times out. - ErrWaitTimeout = errors.New("giving up") + ErrWaitTimeout = errors.New("wait deadline reached") // ErrDeployment is the error returned for terminal deployment failures. ErrDeployment = errors.New("deployment failed") ) diff --git a/client/go/internal/vespa/target_cloud.go b/client/go/internal/vespa/target_cloud.go index d07b2c77ab4..6883515cee5 100644 --- a/client/go/internal/vespa/target_cloud.go +++ b/client/go/internal/vespa/target_cloud.go @@ -316,10 +316,10 @@ func (t *cloudTarget) AwaitDeployment(runID int64, timeout time.Duration) (int64 } _, err = t.deployServiceWait(jobSuccessFunc, requestFunc, timeout) if err != nil { - return 0, fmt.Errorf("deployment run %d incomplete%s: %w", runID, waitDescription(timeout), err) + return 0, fmt.Errorf("deployment run %d not yet complete%s: %w", runID, waitDescription(timeout), err) } if !success { - return 0, fmt.Errorf("deployment run %d incomplete%s", runID, waitDescription(timeout)) + return 0, fmt.Errorf("deployment run %d not yet complete%s", runID, waitDescription(timeout)) } return runID, nil } |