- Notifications
You must be signed in to change notification settings - Fork927
chore: add logging for coderdtest server lifecycle#17376
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -421,6 +421,7 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can | ||
handler.ServeHTTP(w, r) | ||
} | ||
})) | ||
t.Logf("coderdtest server listening on %s", srv.Listener.Addr().String()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. suggestion: extract for later re-use in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I'm paranoid, and would prefer to re-query them. | ||
srv.Config.BaseContext = func(_ net.Listener) context.Context { | ||
return ctx | ||
} | ||
@@ -433,7 +434,12 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can | ||
} else { | ||
srv.Start() | ||
} | ||
t.Logf("coderdtest server started on %s", srv.URL) | ||
johnstcn marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
t.Cleanup(func() { | ||
t.Logf("closing coderdtest server on %s", srv.Listener.Addr().String()) | ||
srv.Close() | ||
t.Logf("closed coderdtest server on %s", srv.Listener.Addr().String()) | ||
}) | ||
tcpAddr, ok := srv.Listener.Addr().(*net.TCPAddr) | ||
require.True(t, ok) | ||
Uh oh!
There was an error while loading.Please reload this page.