Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: improve error logging in TestServer/EphemeralDeployment #17184

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

Merged

Conversation

hugodutka
Copy link
Contributor

There's a flake reported in coder/internal#549 that was caused by the built-in Postgres failing to start. However, the test was written in a way that didn't log the actual error which caused Postgres to fail. This PR improves error logging in the affected test so that the next time the error happens, we know what it is.

@hugodutka hugodutka changed the title chore: improve error handling in TestServer/EphemeralDeployment chore: improve error logging in TestServer/EphemeralDeployment Apr 1, 2025
@hugodutka hugodutka marked this pull request as ready for review April 1, 2025 10:45
@hugodutka hugodutka requested a review from johnstcn April 1, 2025 10:46
Comment on lines +211 to +213
case <-matchCh1:
// OK!
}
Copy link
Member

Choose a reason for hiding this comment

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

If you have the matched string here, why not move the assertions from L214-220 in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to keep modifications to the existing test to a minimum.

Comment on lines 222 to 231
matchCh2 := make(chan string, 1)
go func() {
matchCh2 <- pty.ExpectMatchContext(ctx, "View the Web UI")
}()
select {
case err := <-errCh:
require.NoError(t, err)
case <-matchCh2:
// OK!
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we actually care about this message being logged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a decent indicator that the server was successfully set up. Let me add a comment about it.

@hugodutka hugodutka merged commit 7d08bf0 into main Apr 1, 2025
30 checks passed
@hugodutka hugodutka deleted the hugodutka/testserver-ephemeraldeployment-err-handling branch April 1, 2025 11:23
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants