Skip to content

bug: flaky ZCode pending boundary timeout assertion #2080

Closed

Description

@PsiACE

Describe the bug

ZCode's pending preserves concurrent receipts and pauses unknown writes test intermittently returns failed instead of unknown.

Its 800 ms timeout includes filesystem work before HTTP dispatch. If that work exhausts the budget, the request is never sent and failed is valid. A controlled delay reproduces this path; the original CI log does not establish whether it was the cause there.

Steps to reproduce

  1. Check out 42069c5e05fa0f4739394c7d3bc613c909524172 (PR refactor(cli): unify agent installation lifecycle #2052).

  2. Run:

    node --test integrations/zcode/plugins/powercontext/tests/*.test.mjs
  3. The failure is intermittent. To reproduce the pre-dispatch path, inject a 900 ms delay before the final temporary pause-file unlink in the test's unknown case. This produces the same assertion failure without dispatching the intended request.

Expected behavior

Synchronize cancellation with fixture request arrival so the test exercises uncertain delivery reliably. Preserve failed for unsent requests and unknown for uncertain delivery.

Actual behavior

  • Initial CI failure: 22 passed, 1 failed; boundary.test.mjs:285 expected unknown, received failed.
  • Same-commit rerun: all 23 Node tests and the complete acceptance job passed without code changes.

Environment

  • CI: windows-latest, Node 24.21.0; ZCode acceptance / controlled-cli.
  • Controlled reproduction: Linux, Node 22.22.1. The injected delay is not a measurement of Windows runner latency.

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.

Activity

  1. luochen211 commented on Oct 20, 2026

    @luochen211
    Contributor

    I'd like to take this one.

    Plan: in the unknown case, hold the fixture response and abort the flush from the server's request-arrival hook instead of relying on the 800 ms timeout, so cancellation always happens after dispatch and the test reliably exercises uncertain delivery.

  2. moved this from Todo to In progress in PowerContexton Oct 20, 2026
  3. moved this from In progress to Done in PowerContexton Oct 20, 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

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions