Skip to content

Add timestamp suffix to Nix repos and build name for test isolation#3562

Merged
agrasth merged 1 commit into
masterfrom
fix/nix-repo-buildname-timestamp-suffix
Jun 22, 2026
Merged

Add timestamp suffix to Nix repos and build name for test isolation#3562
agrasth merged 1 commit into
masterfrom
fix/nix-repo-buildname-timestamp-suffix

Conversation

@agrasth

@agrasth agrasth commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Problem

NixLocalRepo, NixRemoteRepo, NixVirtualRepo and NixBuildName are missing from AddTimestampToGlobalVars() in utils/tests/utils.go. Every other package manager's repositories and build name receive the unique -<runId>-<timestamp> suffix, but the Nix ones stay literal (cli-nix-local, cli-nix-remote, cli-nix-virtual, cli-nix-build).

This is invisible in this repo's CI because each job runs against its own ephemeral local Artifactory. But when multiple Nix test runs execute concurrently against a shared Artifactory instance, they all create and clean up the same repositories:

  1. Run A: InitBuildToolsTestscreateRequiredRepos() creates cli-nix-virtual
  2. Run B: InitBuildToolsTestscleanUpOldRepositories() deletes cli-nix-virtual
  3. Run A: initNixTestisRepoExist(cli-nix-virtual) → false → require.True fails with "Nix test virtual repository doesn't exist."

Observed: 14 of 15 concurrent Nix runs failed this way; the repos are created unsuffixed and then deleted out from under each other.

Fix

Add the four Nix globals to AddTimestampToGlobalVars() so each run's repositories and build name are unique and isolated — matching how every other package manager is already handled (and mirroring the earlier UvBuildName fix).

Testing

  • go vet ./utils/tests/ passes.
  • Four-line change, consistent with the surrounding lines in the same function.

NixLocalRepo, NixRemoteRepo, NixVirtualRepo and NixBuildName were missing from
AddTimestampToGlobalVars, so every Nix integration test run used the literal
names cli-nix-local / cli-nix-remote / cli-nix-virtual / cli-nix-build while
every other package manager's repos and build name receive the unique
"-<runId>-<timestamp>" suffix.

This is invisible in CI here because each job runs against its own ephemeral
local Artifactory. But when multiple Nix test runs execute concurrently against
a shared Artifactory instance, InitBuildToolsTests -> cleanUpOldRepositories
deletes another run's just-created cli-nix-* repositories, so initNixTest's
isRepoExist checks fail with "Nix test virtual repository doesn't exist".

Adding the suffix makes each run's Nix repos and build name unique, matching how
every other package manager is already handled (mirrors the earlier UvBuildName
fix).
@github-actions

Copy link
Copy Markdown
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@agrasth agrasth merged commit c00f517 into master Jun 22, 2026
94 checks passed
@agrasth agrasth deleted the fix/nix-repo-buildname-timestamp-suffix branch June 22, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants