test: fix timeouts#3
Merged
Merged
Conversation
rhuanbarreto
added a commit
that referenced
this pull request
Feb 28, 2026
* test: fix timeouts * fix: add git credentials to test * docs: capture learnings * ci: update workflow name to comply with org setup * refactor: format fix
rhuanbarreto
added a commit
that referenced
this pull request
Mar 3, 2026
fix(ci): add explicit permissions to workflows missing them Resolves code scanning alerts #1, #2, #3 (actions/missing-workflow-permissions) by adding `permissions: contents: read` to the three workflows that lacked a top-level permissions block, following the principle of least privilege. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Merged
rhuanbarreto
added a commit
that referenced
this pull request
Mar 3, 2026
* test: fix timeouts * fix: add git credentials to test * docs: capture learnings * ci: update workflow name to comply with org setup * refactor: format fix
rhuanbarreto
added a commit
that referenced
this pull request
Mar 3, 2026
fix(ci): add explicit permissions to workflows missing them Resolves code scanning alerts #1, #2, #3 (actions/missing-workflow-permissions) by adding `permissions: contents: read` to the three workflows that lacked a top-level permissions block, following the principle of least privilege. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
rhuanbarreto
added a commit
that referenced
this pull request
Mar 4, 2026
* test: fix timeouts * fix: add git credentials to test * docs: capture learnings * ci: update workflow name to comply with org setup * refactor: format fix
rhuanbarreto
added a commit
that referenced
this pull request
Mar 4, 2026
fix(ci): add explicit permissions to workflows missing them Resolves code scanning alerts #1, #2, #3 (actions/missing-workflow-permissions) by adding `permissions: contents: read` to the three workflows that lacked a top-level permissions block, following the principle of least privilege. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two root causes of test failures observed in CI and codifies the fixes as governance rules in ARCH-005.
1. MCP server event loop retention (Linux hang)
McpServerfrom@modelcontextprotocol/sdkinternally creates anAjvJsonSchemaValidator(backed byajv+ajv-formats) that holds references keeping Bun's event loop alive after all tests complete. On Linux this causedbun testto hang indefinitely — all tests passed but the process never exited. On macOS the event loop drained normally, making this a CI-only failure that was hard to reproduce locally.Fix: Moved
McpServerinstantiation from individual test bodies intobeforeEach/afterEachhooks across all MCP test files, withawait server.close()called inafterEachto release internal references. Applied to 7 test files:resources,server,tools,check,list-adrs,review-context,session-context.2. Git identity missing in temp repos (CI commit failures)
Tests that created a temporary git repo and ran
git commitpassed locally (where developers have a global git identity) but failed silently in CI with a crypticShellPromiseerror — the root cause being that CI runners have no globaluser.email/user.nameconfigured.Fix: Added explicit
git config user.emailandgit config user.nameto thegit-filestest immediately aftergit init, before any commit is made.3. CI safety nets
Added
timeout-minutesto all workflow jobs (code-pull-request.yml,release.yml,release-binaries.yml) to cap any future event loop or test hangs at the job level. Also set a per-test timeout viabun test --timeout 60000inpackage.jsonso individual slow tests fail fast rather than blocking the suite indefinitely.4. ADR and agent memory updates
Both fixes are codified in ARCH-005 (Testing Standards):
afterEach; configure local git identity beforegit commitin temp reposAgent memory (
MEMORY.md) updated with both patterns for future sessions.Test plan
bun run validatepasses locally (lint → typecheck → format → test → ADR check)validatejob completes without hanging on Linuxgit-filestest passes in CI