Skip to content

test(driver): stabilize backpressure and native lifecycle fixtures - #137

Open
FradSer wants to merge 5 commits into
langgenius:mainfrom
FradSer:test/backpressure-flush-synchronization
Open

FradSer wants to merge 5 commits into
langgenius:mainfrom
FradSer:test/backpressure-flush-synchronization

Conversation

@FradSer

@FradSer FradSer commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The below-limit backpressure test can fail after drainServerMessages() returns because that method drains admitted messages. It does not wait for the child process to finish writing the whole burst.

Wait for both the child write callback marker and delivery of the last notification. Read fresh file state after that signal. Keep the blocked-handler assertion, 900-message delivery, 1,024-message queue limit, overflow rejection, and exact protocol-error count.

The backpressure hunk is extracted from #136 onto current main. Additional fixture failures were reproduced during the complete local checks below. The final diff changes four test files only. It contains no runtime, cancellation, recovery, protocol, dependency, or generated-file changes.

The ACP file-report fixture used matching 50 ms timers for the provider response and file-report failure. The report could fail before the response was accepted, while the assertions required the response-accepted path. Wait for the existing permission-ingress closure before releasing the failed report. Keep the terminal fence, exact error, one failed terminal, lifecycle failure, disconnected state, and cleanup checks.

The cancellation/recycle fixture could release its cancellation-event gate after the provider logged session/cancel, before the provider wrote the late-child PID. Wait for that PID before releasing the gate. The existing assertion still requires the child to be gone before the session resumes.

The ACK-unknown terminal-creation fixture also requires a real child PID for its cleanup assertion. Wait for the child to write that PID inside the first created-event callback, before injecting receipt loss. Retain replay identity, process-exit, terminal-capacity, and release-retry assertions.

The native skill-discovery test runs two CLI commands, each with an existing 10-second bound. Set its outer test budget to the same 30 seconds used by the other native contract tests in this file. The previous default five-second test deadline could interrupt the second command and leak a late assertion. Keep the subprocess bounds and discovery/removal assertions unchanged.

Verification

  • Before: Linux ARM64 test file: 54 passed, 1 failed at the premature flush assertion.
  • After: the same file: 55 passed.
  • Backpressure boundary tests: 40/40 passed across 20 repetitions, with no limit or timeout increase.
  • ACP fixture before: 14/20 passed, 6 failed at the lifecycle assertion. After: 20/20 passed; the complete ACP file passed 57/57.
  • Cancel/recycle fixture before: 19/20 passed, 1 failed because the child PID file was absent. After: 20/20 passed, with the process-exit assertions unchanged.
  • Terminal receipt-loss fixture before: 8/10 passed, 2 failed because cleanup preceded PID creation. After: 10/10 passed.
  • Native OpenCode contract file: 4/4 passed, using local HTTP fixtures. No paid inference.
  • Final standalone Linux Driver, Host, and CI receipts are recorded in the PR comments. Local checks run with no network access or provider credentials.
  • Host integration: feat(providers): support opencode go subscriptions mosoo#684 pins this test-only commit. Other Host PRs retain their existing scope.
  • No live model calls or paid Sessions are used.

@FradSer FradSer changed the title test(openai): synchronize backpressure burst completion test(driver): synchronize backpressure and acp failure fixtures Oct 20, 2026
@FradSer FradSer changed the title test(driver): synchronize backpressure and acp failure fixtures test(driver): stabilize backpressure and native lifecycle fixtures Oct 20, 2026
@FradSer

FradSer commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Final verification for Driver cff74b0d and Host e940702a:

  • Driver CI passed. This includes the full check, native Claude/Codex/Pi lifecycle tests, and build plus environment/tool smoke checks for all five image profiles (all, claude, openai, opencode, pi).
  • Standalone Linux ARM64 full Driver check passed: 2,286 passed / 43 skipped / 0 failed, plus 1 packed MCP replay/recovery/cancellation test passed. Frozen dependencies came from the Driver lockfile. The check ran offline without provider credentials.
  • Host #684 CI passed on the consuming pin. The exact-source local Host full gate passed 3,861 tests / 44 skipped / 0 failed. The separate local native Host checkpoint passed 1/1, with three verified bundles, two ready backups, and history restored in a new process.
  • Repeated regression results: backpressure 40/40; committed-file response acceptance 20/20; cancelled-provider tree 20/20; terminal ACK-unknown creation 10/10. The native OpenCode contract file passed 4/4.

The diff changes four test files only. Runtime code, queue limits, subprocess timeouts, protocols and dependencies are unchanged. The native skill-discovery test outer budget is explicitly 30 seconds, as in the other native contract tests. Both PRs include their current main base with zero behind commits.

No paid model Session, real-provider acceptance run or deployment was added. Land this Driver change first, then repin Host #684 to its landed main commit before merging the Host PR. Host #693 keeps its pricing-only scope and original Driver pin.

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