Skip to content
Merged
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
8 changes: 7 additions & 1 deletion coderd/coderdtest/coderdtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: extract for later re-use in defer() below

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'm paranoid, and would prefer to re-query them.

srv.Config.BaseContext = func(_ net.Listener) context.Context {
return ctx
}
Expand All @@ -433,7 +434,12 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
} else {
srv.Start()
}
t.Cleanup(srv.Close)
t.Logf("coderdtest server started on %s", srv.URL)
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)
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy