fix(pprof): settings rates can be nil

This commit is contained in:
Quentin McGaw
2023-04-12 10:14:05 +00:00
parent d4f8eea7bf
commit fa7fd5f076
6 changed files with 63 additions and 52 deletions

View File

@@ -26,6 +26,8 @@ func Test_Server(t *testing.T) {
const httpServerShutdownTimeout = 10 * time.Second // 10s in case test worker is slow
settings := Settings{
BlockProfileRate: intPtr(0),
MutexProfileRate: intPtr(0),
HTTPServer: httpserver.Settings{
Address: address,
Logger: logger,
@@ -112,7 +114,8 @@ func Test_Server_BadSettings(t *testing.T) {
t.Parallel()
settings := Settings{
BlockProfileRate: -1,
BlockProfileRate: intPtr(-1),
MutexProfileRate: intPtr(0),
}
server, err := New(settings)