Skip to content

test: stub gh in GitService tests so CI does not time out - #17

Merged
wangyuling93 merged 1 commit into
mainfrom
fix/git-service-gh-timeout
Aug 15, 2026
Merged

test: stub gh in GitService tests so CI does not time out#17
wangyuling93 merged 1 commit into
mainfrom
fix/git-service-gh-timeout

Conversation

@wangyuling93

@wangyuling93 wangyuling93 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Related Issue

No issue. Fixes the test (1) failure on the release PR: https://github.com/wangyuling93/kimi-code/actions/runs/31871049089

Problem

GitService.status() always ends with gh pr view (PR_SPAWN_TIMEOUT_MS = 5000). The suite used a real HostProcessService, so on GitHub Actions (where gh is installed) the first invocation can sit until that spawn timeout and race vitest's 5s default.

Failed test:

FAIL  agent-core-v2  test/app/git/gitService.test.ts > GitService > status > reports a clean tree
Error: Test timed out in 5000ms.

Later cases in the same file passed because subsequent gh calls return quickly.

What changed

Stub gh at the IHostProcessService boundary. Real git / filesystem still run against a temp repo. Also cover the pull-request fold: success parsing and same-cwd cache.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

status() always runs `gh pr view` with a 5s spawn timeout. On GitHub
Actions the first real gh invocation can sit until that limit, racing
vitest's 5s default and failing shard 1.
@wangyuling93
wangyuling93 merged commit 637ed83 into main Aug 15, 2026
17 checks passed
@wangyuling93
wangyuling93 deleted the fix/git-service-gh-timeout branch August 15, 2026 08:35
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