From 569afcc887a605bf69b5465a5143a1265798dbc9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 01:59:07 +0000 Subject: [PATCH] fix(sync): eliminate periodic sync race in TestDockerImagesAreSkipped The test only exercises on-demand sync but had `PollInterval: 30m` set with non-empty `Content`, causing the scheduler to immediately start a background periodic sync goroutine on server startup. This goroutine created temporary `.sync/` directories inside `destDir/zot-test` concurrently with the test's `os.RemoveAll(destDir/testImage)`, causing an intermittent "directory not empty" failure. Fix: remove `PollInterval` from the sync registry config so the periodic sync generator is never registered with the scheduler. On-demand sync (the only mode exercised by this test) is unaffected. Agent-Logs-Url: https://github.com/project-zot/zot/sessions/1a321663-3147-46e9-9321-989e5dd0ed3c Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com> --- pkg/extensions/sync/sync_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/extensions/sync/sync_test.go b/pkg/extensions/sync/sync_test.go index 839b630e..af1a52f3 100644 --- a/pkg/extensions/sync/sync_test.go +++ b/pkg/extensions/sync/sync_test.go @@ -1417,8 +1417,6 @@ func TestDockerImagesAreSkipped(t *testing.T) { for _, testCase := range testCases { Convey("Verify docker images are skipped when they are already synced, preserveDigest: "+testCase.name, t, func() { - updateDuration, _ := time.ParseDuration("30m") - sctlr, srcBaseURL, srcDir, _ := makeUpstreamServer(t, false, false) scm := test.NewControllerManager(sctlr) @@ -1443,7 +1441,6 @@ func TestDockerImagesAreSkipped(t *testing.T) { }, }, URLs: []string{srcBaseURL}, - PollInterval: updateDuration, TLSVerify: &tlsVerify, CertDir: "", MaxRetries: &maxRetries,