Skip to content

test(codebuddy): feed the abort fixture's stdout once - #7948

Merged
lidge-jun merged 1 commit into
devfrom
fix/codebuddy-abort-test-flood
Oct 29, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/codebuddy-abort-test-flood

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

tests/providers/codebuddy-adapter.test.ts > an in-flight abort kills the child process gracefully with SIGTERM timed out in two consecutive full-suite test changed jobs on #7884 (7306ms and 5478ms; runs 40820340584 and 40824645979). #7884 changes the test-home guard, so its test changed job runs all ~51k tests in one process.

The cause is in the fixture. The fake child's stdout read() pushed the same line and scheduled another controller.abort() timer on every call. Each push invites the next read(), so the stream floods the event loop with data and timers until the abort lands. The case took about 1.3s even on an idle machine, and under a loaded single-job suite it ran past the 5s limit.

This feeds the line and schedules the abort exactly once. The adapter, the kill-grace path and every assertion are unchanged: the child is killed with SIGTERM, an error event is emitted, and no done event is emitted.

Verification

Windows x64, OCX_TEST_NO_QUEUE=1:

  • Before: bun test tests/providers/codebuddy-adapter.test.ts -t 'gracefully with SIGTERM': pass in 1338.36ms.
  • After: the same case passes in 12.46ms; the full file passes 45 / 0.
  • bun run typecheck: exit 0. tests/ci-workflows/file-size-ratchet.test.ts: 9 pass / 0 fail.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. N/A: test fixture only.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. N/A: no product code changes.

Summary by CodeRabbit

  • Tests
    • Updated automated checks for stopping an in-progress response. No user-facing behavior changes are included in this update.

read() pushed and scheduled another abort on every call, flooding the stream until the abort landed; the SIGTERM case took ~1.3s idle and timed out in loaded full-suite jobs. It now takes ~12ms.
@lidge-jun lidge-jun added the bug Something isn't working label Oct 29, 2026
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 29, 2026 06:01
@lidge-jun lidge-jun added the bug Something isn't working label Oct 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T06:02:27.411882Z 3fe40ce PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 9b78a16 and 3fe40ce.

Files selected for processing: 1
  • tests/providers/codebuddy-adapter.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

The in-flight abort test now emits its partial delta and schedules the abort only on the first stream read. Later reads return without repeating those actions.

Changes: In-flight abort test

Layer / File(s) Summary
Limit repeated stream actions
tests/providers/codebuddy-adapter.test.ts
The test stream uses a flag to push the partial delta and schedule the abort once. The comment explains that repeated pushes flooded the stream and timer queue.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested labels: chore

Merge Risk: Minimal · up to 3fe40

The fixture now limits output and abort scheduling to one cycle, with no production behavior changed.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(codebuddy): feed the abort fixture's stdout once" describes the main change: the fake child's stdout in the in-flight abort test now feeds data and schedules the abort only once, inste…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(codebuddy): feed the abort fixture's stdout once" describes the main change: the fake child's stdout in the in-flight abort test now feeds data and schedules the abort only once, instead of on every read. It is concise, specific, and follows a clear conventional-commit style. It does not mention the timeout fix motivation, but that detail is not required for the title to convey the primary change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun
lidge-jun merged commit 26224ad into dev Oct 29, 2026
34 of 36 checks passed
@lidge-jun
lidge-jun deleted the fix/codebuddy-abort-test-flood branch October 29, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant