-
Notifications
You must be signed in to change notification settings - Fork 883
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
chore: improve error logging in TestServer/EphemeralDeployment #17184
Conversation
case <-matchCh1: | ||
// OK! | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
cli/server_test.go
Outdated
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! | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.