Skip to content

fix(integration): make integration test pass on macOS#185

Open
xytan0056 wants to merge 1 commit into
mainfrom
fix/integration-test-repo-remote
Open

fix(integration): make integration test pass on macOS#185
xytan0056 wants to merge 1 commit into
mainfrom
fix/integration-test-repo-remote

Conversation

@xytan0056

@xytan0056 xytan0056 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor
  1. fixes CI
    https://github.com/uber/tango/actions/runs/29140659260/job/86512997744#step:3:520
    GetChangedTargets computes two graphs in parallel; both raced to download the same bazel release, corrupting it (exit status 22) then hanging to the deadline.

  2. And mac

    --- FAIL: TestIntegration_GetChangedTargets/changed_only (1.85s)
        integration_test.go:285: 
                Error Trace:    integration/integration_test.go:285
                                  integration/integration_test.go:296
                                  integration/integration_test.go:420
                Error:          Received unexpected error:
                                code:unknown message:failed to get target graph #1: create bazel client: detect bazel executable: cache dir: $HOME is not defined

the inner bazel failed with $HOME is not defined and SSL cert errors while re-downloading.

Fix:

  • Pass HOME through to the sandbox so the inner bazel reuses the release the outer bazel test already downloaded — no in-test download, no race.
  • Set bazel_command to the repo's pinned tools/bazel so inner and outer share one cache instead of fetching bazelisk from GitHub latest. ${BAZEL} is alreayd called in makefile rule, so by the time integ test is run, it's already downloaded
  • Drop the per-server XDG_CACHE_HOME override.

##test
verified make test-integration passes locally on mac
verified CI

The bazel test sandbox strips HOME, which the pinned tools/bazel wrapper
(Python bazelisk) requires — on macOS it resolves its cache only via HOME
and ignores XDG_CACHE_HOME. The old per-server XDG_CACHE_HOME override also
pointed the inner bazel at a cold cache, so on Linux CI two parallel graph
computations in GetChangedTargets raced to download the same bazel release
(corrupt binary -> exit status 22, then a hang), and on macOS the inner bazel
failed with "$HOME is not defined" / SSL cert errors while re-downloading.

- Pass HOME through to the sandbox so the inner bazel reuses the release the
  outer `bazel test` already downloaded (no in-test download, no race).
- Set bazel_command to the repo's pinned tools/bazel so inner and outer share
  the same cache instead of fetching bazelisk from GitHub latest.
- Drop the per-server XDG_CACHE_HOME override.
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.

1 participant