Skip to content

Give each test process its own fixture extraction - #115

Merged
hannesa2 merged 1 commit into
masterfrom
per-run-fixture-cache
Sep 30, 2026
Merged

hannesa2 merged 1 commit into
masterfrom
per-run-fixture-cache

Conversation

@goneng

@goneng goneng commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Give each test process its own copy of the unzipped fixtures, so concurrent test runs can't collide and no run reuses fixtures extracted from another branch's fixtures.zip.

  • Replace the machine-wide $TMPDIR/com.libgit2.objectivegit/clean_repository cache with a clean_repository-<unique id> directory created once per test process (about 1.5 s to unzip).
  • Remove that directory at process exit.
  • Follow the same no-shared-state approach GitX's own tests use (a unique temp folder per test, removed in tearDown).

Setting TMPDIR / TEST_RUNNER_TMPDIR is not an alternative: NSTemporaryDirectory() ignores TMPDIR on current macOS.

Test plan

  • Ran the full suite twice at the same time from one build: 287 tests each, only the 4 known failures (Libgit2FeaturesSpec x3, GTSubmoduleSpec sync URL), same as master after Fix the test fixtures failing to unzip #113.
  • Ran GTRepositorySpec twice at the same time while sampling the temp root: two distinct clean_repository-* directories existed at the same time, both removed after exit, and the old shared clean_repository was left untouched.

🤖 Generated with Claude Code

The unzipped fixtures were cached in one clean_repository directory
shared by every test run on the machine, so concurrent runs from
different checkouts collided, and a run reused whatever fixtures.zip
another branch had extracted before it.

- Unzip into clean_repository-<unique id> once per test process, the
  same no-shared-state approach GitX's own tests use for temp folders.
- Remove that directory when the process exits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hannesa2
hannesa2 merged commit 7cf739d into master Sep 30, 2026
2 checks passed
@hannesa2
hannesa2 deleted the per-run-fixture-cache branch September 30, 2026 04:21
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.

2 participants