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")