diff --git a/server/.golangci.yml b/server/.golangci.yml index 5759d13f48..76e9883096 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -123,7 +123,6 @@ issues: channels/app/slashcommands/auto_environment.go|\ channels/app/slashcommands/command_test.go|\ channels/app/slashcommands/helper_test.go|\ - channels/app/status_test.go|\ channels/app/support_packet_test.go|\ channels/app/team.go|\ channels/app/team_test.go|\ diff --git a/server/channels/app/status_test.go b/server/channels/app/status_test.go index 1dcc6f5596..2aff8654c5 100644 --- a/server/channels/app/status_test.go +++ b/server/channels/app/status_test.go @@ -177,7 +177,13 @@ func TestSetCustomStatus(t *testing.T) { } { t.Run(testCase.Name, func(t *testing.T) { err := th.App.SetCustomStatus(th.Context, th.BasicUser.Id, testCase.Input) - defer th.App.RemoveCustomStatus(th.Context, th.BasicUser.Id) + + if err == nil { + defer func() { + removeErr := th.App.RemoveCustomStatus(th.Context, th.BasicUser.Id) + require.Nil(t, removeErr) + }() + } if testCase.ExpectsError { require.NotNil(t, err)