Skip to content

ci: [debug, do not merge] find why webfetch and workspace-sync tests hang on CI - #1871

Closed
RaghwendraSingh wants to merge 3 commits into
mainfrom
debug/ci-test-hang
Closed

RaghwendraSingh wants to merge 3 commits into
mainfrom
debug/ci-test-hang

Conversation

@RaghwendraSingh

@RaghwendraSingh RaghwendraSingh commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Do not merge: temporary CI debugging

Purpose. Find why CI has been red on main and every PR since about 06:44 UTC on 2026-12-01. This PR will be closed and its branch deleted once the cause is known. It changes no product code.

The problem. On the CI runners, the first two tests of test/tool/webfetch.test.ts and several workspace-sync tests (test/altimate/workspace/sync-state.test.ts, test/control-plane/workspace.test.ts) hang for minutes, far past the 90-second test timeout. The shard then fails, or the runner is shut down mid-job (exit 137/143). The code, runner image and Bun version are the same as in the passing runs of the day before, and the same files pass locally on macOS.

What this PR adds.

  • .github/workflows/debug-test-hang.yml: a workflow that runs only for this branch. It runs the two test groups alone and inside their shards (2 and 3), with the same setup as the TypeScript job.
  • script/github/debug-test-hang.sh: whenever test output stops for 45 seconds, it prints the process tree, the test process's sockets and open files, and its system calls.

Review. No review needed. Review bots can ignore this PR.

🤖 Generated with Claude Code


Summary by cubic

Temporary, do-not-merge CI debugging PR: run stalled on main and every PR since 2026-12-01 when test/tool/webfetch.test.ts and several workspace-sync tests hang past the 90-second timeout, then fail the shard or get killed (exit 137/143). The diagnosis is confirmed: tests that write a tool or plugin file into a config dir make the app start a real npm install of @opencode-ai/plugin inside the test process, and that install is never awaited, so it outlives the test and starves the event loop.

  • The debug workflow now runs all four shards and reports every npm registry request the stuck process makes.
  • Candidates fix under test: ConfigPlugin.shouldInstallDependencies returns false when ALTIMATE_DISABLE_DEPENDENCY_INSTALL=1, which test/preload.ts sets; the config and TUI tests that check when an install is requested clear it and use a recording installer that never reaches the network.
  • Changes no product behavior for real users; the branch will be deleted once the fix is confirmed.

Written for commit 83895fc. Summary will update on new commits.

View guided diff Turn on auto-fix

…s hang on CI

Debug only, not for merge. Runs the two hanging test groups alone and inside
their shards, and prints the test process's sockets, open files and syscalls
whenever test output stops for 45 seconds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Hey! Your PR title ci: [debug, do not merge] find why webfetch and workspace-sync tests hang on CI doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.
  • "Cost side effects" section is missing or empty. Describe any model calls, queries or cloud resources whose cost grows with user data, or write "None".

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

RaghwendraSingh and others added 2 commits December 1, 2026 15:16
Run 1 showed the stuck test process holding dozens of connections to the npm
registry and writing `~/.npm/_cacache` while no test made progress. This run
lists the packages fetched, and runs shard 3 with and without
`test/tool/registry.test.ts` to confirm where the installs start.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…n installs

Run 2 confirmed the cause: tests that write a tool or plugin file into a config
dir make the app start an `npm install` of `@opencode-ai/plugin` there, in the
test process and not awaited. Shard 3 passes with `test/tool/registry.test.ts`
left out and fetches nothing from npm.

Candidate fix under test here:
- `ConfigPlugin.shouldInstallDependencies` returns false when
  `ALTIMATE_DISABLE_DEPENDENCY_INSTALL=1`; `test/preload.ts` sets it.
- The config and TUI tests that check when an install is requested clear it;
  they use a recording installer and never reach the network.

The debug workflow now runs all four shards with the npm-request report.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@RaghwendraSingh

Copy link
Copy Markdown
Contributor Author

Closing: the cause was found here and fixed in #1872, which is merged. The tests started real in-process npm installs of the plugin package that outlived the test and starved the test process. This branch only held the debug workflow and script.

@RaghwendraSingh
RaghwendraSingh deleted the debug/ci-test-hang branch December 1, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant