Skip to content

test(runtime-host): bound test wait helpers by wall-clock deadlines - #4566

Open
ggbdpq wants to merge 1 commit into
apache:mainfrom
ggbdpq:test/runtime-host-wait-deadlines
Open

test(runtime-host): bound test wait helpers by wall-clock deadlines#4566
ggbdpq wants to merge 1 commit into
apache:mainfrom
ggbdpq:test/runtime-host-wait-deadlines

Conversation

@ggbdpq

@ggbdpq ggbdpq commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Verification

Claim Command Result
Converted suites pass node --test dist/__tests__/runtime-policy-coordinator.test.js 19 tests: 18 pass, 1 skip, 0 fail
UDS turn settles within the wall-clock budget node --test dist/__tests__/plan-two-client-uds.test.js 1 test, 1 pass
Peer roster propagation passes node --test dist/__tests__/peer-mesh.test.js 20 tests, 20 pass, 0 fail
Repo format npm run format:check Checked 1854 files, no issues
ASF headers npm run check:asf-headers Every source file carries the ASF header or a reviewed exclusion
Pre-existing Windows failures are not from this change Same suites run with the change stashed vs applied execution-model-composition: 1 fail both ways (EBUSY unlink of runtime.sqlite in the DeepSeek auxiliary-calls cleanup, reproduces on unpatched main); peer-native: 2 fails both ways (ERR_UNSUPPORTED_ESM_URL_SCHEME on Windows dynamic import). Two converted suites that used to rely on the old budgets now complete normally on this machine
Note on scope - execution-model-composition.test.js previously stopped producing output mid-run on this Windows machine; after conversion the suite runs to completion and reports a full summary. The residual post-summary non-exit of the node process is present with and without the change and is out of scope here

AI use

Analysis, conversion, and verification were produced with GLM-5.3-Flash (ZCode) under the contributor's direction; the contributor reviewed and is the human contributor of record.

Checklist

  • Tests and checks pass locally (pre-existing Windows failures documented with clean-main control runs)
  • Behavioral change: No - test infrastructure only

Several runtime-host test helpers polled for async conditions with a
fixed count of ticks (or fixed ticks x ms) instead of a wall-clock
budget. Under a loaded runner the underlying work can span more ticks
than the loop allows, so the helper gave up early and the test failed in
a way indistinguishable from a real regression (apache#4510, same class as
apache#4383/apache#4387).

Convert the listed loops to the shared waitFor primitive from
`@maka/core/test-only/async-primitives` with an explicit 5s wall-clock
deadline and a small poll interval, keeping each helper's failure
message and assertion shape:

- execution-model-composition.test.ts: the graph-wake loop (400 ticks),
  startTurn (200), waitForTerminal (200), waitForUsage (100),
  waitForCanonicalAttempts (100), waitForCaptureArtifacts (100), and the
  memory-settlement stability loop (100 x 10ms)
- plan-two-client-uds.test.ts: waitForTerminal over a real UDS connection
- runtime-policy-coordinator.test.ts: the inline turn-settlement loop
- peer-mesh.test.ts: the roster propagation loop (20 x 10ms)
- peer-native.test.ts: waitForRequestCount (10 immediates)

Production behavior is unchanged; this is test infrastructure only.
Side observation: the pre-existing EBUSY unlink in the DeepSeek
auxiliary-calls cleanup and the peer-native ESM dynamic-import scheme
error both reproduce identically on unpatched main on Windows and are
left untouched.

Fixes apache#4510

Generated-by: GLM-5.3-Flash (ZCode)
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant