test: stop task scheduler between test runs (#1311)

sync: remove sync WaitGroup, it's stopped with context
sync: onDemand will always try to sync newest image when a tag is used
if a digest is used then onDemand will serve local image
test(sync): fix flaky coverage in sync package
closes #1294

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu
2023-03-29 21:37:58 +03:00
committed by GitHub
parent 0ae35e973a
commit 3dd3c46ee3
8 changed files with 499 additions and 489 deletions
+1 -3
View File
@@ -9,7 +9,6 @@ import (
"net/url"
"os"
"path"
goSync "sync"
"testing"
"time"
@@ -156,8 +155,7 @@ func TestSyncInternal(t *testing.T) {
}
ctx := context.Background()
So(Run(ctx, cfg, mocks.RepoDBMock{}, storage.StoreController{},
new(goSync.WaitGroup), log.NewLogger("debug", "")), ShouldNotBeNil)
So(Run(ctx, cfg, mocks.RepoDBMock{}, storage.StoreController{}, log.NewLogger("debug", "")), ShouldNotBeNil)
_, err = getFileCredentials("/invalid/path/to/file")
So(err, ShouldNotBeNil)