From 626819ac0cfadd1a879a49b651b8badd99aeb135 Mon Sep 17 00:00:00 2001 From: Hasan Mahmood Date: Thu, 30 May 2024 14:53:54 -0400 Subject: [PATCH] Only close if unixServer is non-nil --- cmd/agent/subcommands/flare/command_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {