From 6204304631a5d85a371109ba230154ebf02fb3e3 Mon Sep 17 00:00:00 2001 From: Naveen Kumar Date: Tue, 15 Sep 2026 14:37:46 +0530 Subject: [PATCH] RTECO-0000 - Fix flaky TestApkAdd_DepChecksums by forcing a fresh curl install TestApkAdd_DepChecksums asserts that at least one dependency has a checksum after `jf apk add curl`, but curl is already installed by TestApkAdd_BasicBuildInfo earlier in the same test binary run. That makes the add a no-op that downloads nothing, so there's no cached .apk archive left to compute checksums from, and AQL enrichment can't help either since these packages are fetched directly from the CDN rather than through Artifactory. Uninstall curl first so the test always exercises a real download. --- apk_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apk_test.go b/apk_test.go index 4e7883768..00bf9bf34 100644 --- a/apk_test.go +++ b/apk_test.go @@ -495,6 +495,11 @@ func TestApkAdd_DepChecksums(t *testing.T) { buildName := tests.AlpineBuildName + "-dep-checksums" buildNumber := "1" + // curl may already be installed by an earlier test in this suite (e.g. TestApkAdd_BasicBuildInfo), + // which would make the "apk add curl" below a no-op that downloads nothing — leaving the + // dependencies with no local .apk archive to compute checksums from. Force a real download. + _ = exec.Command("apk", "del", "curl").Run() + jfrogCli := coretests.NewJfrogCli(execMain, "jfrog", "") err := jfrogCli.Exec("apk", "add", "curl", "--build-name="+buildName, "--build-number="+buildNumber,