Skip to content

flake: Bun qualification Stop test races peer cancellation readiness #1087

Closed

Description

@taras

Failure

packages/acp/tests/agent-certification.test.ts — “attributes the owned still-active turn” can time out under Bun because the fixture is not yet ready to process cancellation when the transport reports promptStarted.

First CI failure: run 2369, Bun shard 2/9, commit 6f7a0d868e5499699ff23086de071ce544ba34ed, Bun 1.4.0. The test exceeds its 300,000 ms deadline; the runner kills the dangling child. The complete first job log is retained before any repair.

Scheduling-dependent evidence

At unchanged c089945eb72e3cd90cefe5894b9a12d43b712652, Bun 1.3.14:

bun test --timeout=20000 --test-name-pattern 'attributes the owned still-active turn' packages/acp/tests/agent-certification.test.ts
exit 0; 1,578 ms

bun test --timeout=20000 packages/acp/tests/agent-certification.test.ts
exit 1; 38,072 ms; cancellation test times out and a dangling child is killed

These are the same source and test under different file selections, not an identical full command passing unchanged. Instrumentation using the official digest-verified Bun 1.4.0 reproduces a wait inside execution.stop; later joins complete only after the timeout reaper kills the child.

Cause and bounded correction

promptStarted proves the RPC request was written. The fake peer installs its cancellable activePrompt after asynchronous logging/history I/O; cancellation can arrive before that readiness point.

PR #1085, signed commit f687518a419eff4a7ef30532a9a74aebc819b972, makes the fixture emit WAITING after installing the handler. The test waits for that explicit signal. It still checks Stop, document/output joins, one prompt, session/cancel, the cancelled journal outcome and the actual runtime handle-close promise. No timeout increase, exclusion or production change is used.

The five affected files pass locally under Bun 1.4.0 (141 tests), Deno (36 suites / 141 steps) and Node 22 (141 tests), with final R2 assertion reruns recorded separately. Required CI on the corrected head remains the delivery proof. Keep this issue open until the fix and regression evidence are landed; a green retry alone does not resolve it.

Retained first outputs and regression evidence

Artifact root: /private/tmp/xmd-standard-acp-1081-20261102-1.

  • ci-observation-1/job-125877533559.log
  • work/ticket/attempts/0008/bun-stop-first-receipt.json and .log
  • work/ticket/attempts/0008/bun-certification-baseline-receipt.json and .log
  • work/ticket/attempts/0008/ci-repair-handoff.md
  • work/ticket/attempts/0008/command-receipts.json and final Bun/Deno/Node receipts
  • work/ticket/attempts/0009/acceptance-review.md

Tracking marker: 1081-bun-certification-cancel-readiness.

Activity

  1. added
    flakeIntermittent or timing-sensitive failure that can pass without a code change
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flakeIntermittent or timing-sensitive failure that can pass without a code change

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions