Skip to content

test: stop a stalled Intel clone from failing the next test - #32

Merged
erunion merged 2 commits into
masterfrom
erunion/isolate-flaky-ci-clones-d7e6
Dec 2, 2026
Merged

erunion merged 2 commits into
masterfrom
erunion/isolate-flaky-ci-clones-d7e6

Conversation

@erunion

@erunion erunion commented Dec 2, 2026

Copy link
Copy Markdown
Member

Summary

The macOS 15 Intel jobs in run 229 failed twice, on different tests, after a libgit2 operation outlived Mocha's timeout and the next test reused test/repos/clone.

  • Attempt 2 (Node 22): can clone without waiting for callback results hit the 30s timeout while the clone was still writing the pack. can clone using nested function then failed with ENOENT creating objects/pack/*.idx.lock because beforeEach had deleted that directory.
  • Attempt 1 (Node 26): can kill worker thread while doing a checkout and exit gracefully timed out inside worker.terminate(). The next worker test failed with worker reported failure on the same directory.

The 3.3.2 commit only bumps the version. The same runner image passed these tests about 20 minutes earlier. Passing tests are unchanged in duration; a stalled attempt now gets a fresh directory and one retry.

Changes

  • Clone and Worker tests each get their own directory per attempt. The directory is removed when that clone or worker settles, not in beforeEach.
  • Both suites retry once. A stalled fetch or worker.terminate() no longer shares state with the following attempt.
  • Clone suite timeout is 60s, up from 30s, so a slow but live fetch can finish.
  • Worker exit handlers report through done() and ignore the event if the test already finished, so a late assert.fail() cannot throw into the next test.

Test plan

  • npx jshint test/tests/clone.js test/tests/worker.js
  • CI on macos-15-intel for Node 22, 24, and 26
Open in Web Open in Cursor 

macos-15-intel sometimes leaves a libgit2 clone or worker.terminate()
running after Mocha's timeout. Those tests all used test/repos/clone, so
the next test deleted that directory and failed on a missing pack lock.
Give each attempt its own directory, remove it only after the operation
settles, and retry once.

Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Low impact] The PR appears safe to merge; the reported retry race is fixed.

Reviews (2) · Last reviewed commit: "test: keep a retry from deleting the pre..." · Reviewed by Greptile

Comment thread test/tests/clone.js Resolved
The two-clone test removed clonePath after the first fetch. A timeout
starts the retry's beforeEach, which points that variable at the new
directory, so the still-running chain would delete the retry's files.
Snapshot the attempt's path and use it for both clones.

Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
@erunion
erunion merged commit 88a8787 into master Dec 2, 2026
16 checks passed
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