Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeout copy again #978

Merged
merged 6 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions airflow/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ var (
errNoFile = errors.New("file specified does not exist")
errSettingsPath = "error looking for settings.yaml"
errComposeProjectRunning = errors.New("project is up and running")
errWebServerUnHealthy = errors.New("webserver has not become healthy yet")

initSettings = settings.ConfigSettings
exportSettings = settings.Export
Expand Down Expand Up @@ -762,8 +761,8 @@ var checkWebserverHealth = func(settingsFile string, project *types.Project, com
})
if err != nil {
if errors.Is(err, context.DeadlineExceeded) {
fmt.Println("\nProject is not yet running. The project is still attempting to start up. Run 'astro dev logs --webserver | --scheduler' for details.")
return fmt.Errorf("%w: the health check timed out after %s. Use the --wait flag to increase the time out", errWebServerUnHealthy, timeout)
fmt.Printf("\n")
return fmt.Errorf("there might be a problem with your project starting up. The webserver health check timed out after %s but your project will continue trying to start. Run 'astro dev logs --webserver | --scheduler' for details.\n\nTry again or use the --wait flag to increase the time out", timeout) //nolint:goerr113
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you capitalize the first letter of the error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that breaks the linter

}
if !errors.Is(err, errComposeProjectRunning) {
return err
Expand Down
6 changes: 2 additions & 4 deletions airflow/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,7 @@ func TestCheckWebserverHealth(t *testing.T) {
isM1 = mockIsM1

err := checkWebserverHealth(settingsFile, &types.Project{Name: "test"}, composeMock, 2, false, 1*time.Second)
assert.ErrorIs(t, err, errWebServerUnHealthy)
assert.ErrorContains(t, err, "webserver has not become healthy yet: the health check timed out after 1s")
assert.ErrorContains(t, err, "The webserver health check timed out after 1s")
})
t.Run("timeout waiting for webserver to get to healthy with long timeout", func(t *testing.T) {
settingsFile := "./testfiles/test_dag_inegrity_file.py" // any file which exists
Expand Down Expand Up @@ -1455,8 +1454,7 @@ func TestCheckWebserverHealth(t *testing.T) {
isM1 = mockIsM1

err := checkWebserverHealth(settingsFile, &types.Project{Name: "test"}, composeMock, 2, false, 1*time.Second)
assert.ErrorIs(t, err, errWebServerUnHealthy)
assert.ErrorContains(t, err, "webserver has not become healthy yet: the health check timed out after 1s")
assert.ErrorContains(t, err, "The webserver health check timed out after 1s")
})
}

Expand Down