From 69f498c431ab09fbe6396a3740ed3d6f6595d3bc Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Mon, 17 Oct 2022 13:57:41 -0300 Subject: [PATCH] fix(tests): add missing context cancel EE-4433 (#7879) --- api/git/git_integration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/git/git_integration_test.go b/api/git/git_integration_test.go index 45504101e..886003c8d 100644 --- a/api/git/git_integration_test.go +++ b/api/git/git_integration_test.go @@ -274,7 +274,8 @@ func TestService_purgeCacheByTTL_Github(t *testing.T) { func TestService_canStopCacheCleanTimer_whenContextDone(t *testing.T) { timeout := 10 * time.Millisecond - deadlineCtx, _ := context.WithDeadline(context.TODO(), time.Now().Add(10*timeout)) + deadlineCtx, cancel := context.WithDeadline(context.TODO(), time.Now().Add(10*timeout)) + defer cancel() service := NewService(deadlineCtx) assert.False(t, service.timerHasStopped(), "timer should not be stopped")