mirror of https://github.com/portainer/portainer
fix(tests): add missing context cancel EE-4433 (#7879)
parent
669327da7c
commit
69f498c431
|
@ -274,7 +274,8 @@ func TestService_purgeCacheByTTL_Github(t *testing.T) {
|
||||||
|
|
||||||
func TestService_canStopCacheCleanTimer_whenContextDone(t *testing.T) {
|
func TestService_canStopCacheCleanTimer_whenContextDone(t *testing.T) {
|
||||||
timeout := 10 * time.Millisecond
|
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)
|
service := NewService(deadlineCtx)
|
||||||
assert.False(t, service.timerHasStopped(), "timer should not be stopped")
|
assert.False(t, service.timerHasStopped(), "timer should not be stopped")
|
||||||
|
|
Loading…
Reference in New Issue