diff --git a/cmd/agent/subcommands/flare/command_test.go b/cmd/agent/subcommands/flare/command_test.go index d106608f1294f..7af1aa5ba7c5b 100644 --- a/cmd/agent/subcommands/flare/command_test.go +++ b/cmd/agent/subcommands/flare/command_test.go @@ -41,7 +41,9 @@ func (c *commandTestSuite) SetupSuite() { func (c *commandTestSuite) TearDownSuite() { c.tcpServer.Close() - c.unixServer.Close() + if c.unixServer != nil { + c.unixServer.Close() + } } func (c *commandTestSuite) getPprofTestServer() (tcpServer *httptest.Server, unixServer *httptest.Server) {