test(runtime-host): bound test wait helpers by wall-clock deadlines - #4566
Open
ggbdpq wants to merge 1 commit into
Open
test(runtime-host): bound test wait helpers by wall-clock deadlines#4566ggbdpq wants to merge 1 commit into
ggbdpq wants to merge 1 commit into
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/runtime-hosttest helpers polled for asynchronous conditions with a fixed count of ticks (or fixed ticks x ms) instead of a wall-clock budget. Under a loaded CI runner the underlying work (turn settlement over UDS, graph-wake persistence, peer roster propagation, provider request capture) can span more ticks than the loop allows, so the helper gave up early and the failure was indistinguishable from a real regression (test(runtime-host): wait helpers poll on fixed tick budgets and can flake under load #4510, same class as test(runtime): sandbox boundary request wait has no time budget and flakes on CI #4383/fix(runtime): give sandbox boundary wait a time budget #4387).waitForprimitive from@maka/core/test-only/async-primitiveswith an explicit 5s wall-clock deadline and a small poll interval, keeping each helper's failure message and assertion shape. Two helpers with rich diagnostic payloads re-throw those payloads from a catch so the failure text stays identical to before. Production code is untouched - test infrastructure only.Verification
node --test dist/__tests__/runtime-policy-coordinator.test.jsnode --test dist/__tests__/plan-two-client-uds.test.jsnode --test dist/__tests__/peer-mesh.test.jsnpm run format:checknpm run check:asf-headersexecution-model-composition: 1 fail both ways (EBUSY unlink ofruntime.sqlitein the DeepSeek auxiliary-calls cleanup, reproduces on unpatched main);peer-native: 2 fails both ways (ERR_UNSUPPORTED_ESM_URL_SCHEMEon Windows dynamic import). Two converted suites that used to rely on the old budgets now complete normally on this machineexecution-model-composition.test.jspreviously 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 hereAI 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