fix(schedule): abstract simple loops with RunOnInterval() BE-12765 (#2163)

This commit is contained in:
andres-portainer
2026-03-26 07:47:54 -03:00
committed by GitHub
parent e33f9573e8
commit 61b9bc248f
19 changed files with 187 additions and 108 deletions
-13
View File
@@ -340,19 +340,6 @@ func TestService_purgeCacheByTTL_Github(t *testing.T) {
assert.Equal(t, 0, service.repoFileCache.Len())
}
func TestService_canStopCacheCleanTimer_whenContextDone(t *testing.T) {
timeout := 10 * time.Millisecond
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")
<-time.After(20 * timeout)
assert.True(t, service.timerHasStopped(), "timer should be stopped")
}
func TestService_HardRefresh_ListRefs_GitHub(t *testing.T) {
ensureIntegrationTest(t)