Repository navigation
test(runtime-host): wait for event observation I/O by deadline - #6140
Conversation
Extract the event-wait test-only CI fix from apache#6089 so it can land independently. Keep the injected observation clock fixed while awaiting asynchronous Host work. Generated-by: OpenAI Codex
Remove the event-wait test-only change from the Write/Edit evidence PR now that it is proposed independently in apache#6140. Generated-by: OpenAI Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.Reviewed
07bad455b02070e77bac788ffb9611507941d9d3(one test file, +26/-2). This is the same change I reviewed inside #6089 (50565abd). I found no P0–P2 issue. CItestpasses, and the PR is mergeable.
eventually() in event-wait-manager.test.ts now polls on a 5 s monotonic deadline with 5 ms sleeps, instead of 100 rounds of setImmediate. Real Host I/O therefore gets wall-clock time to finish, while the injected observation clock stays fixed. Timeout, Retry-After and cancellation assertions keep their exact meaning. The added self-test checks that delayed host work completes without advancing the observation clock or firing its timers. This fixes the flaky late-authorization and slow-cooldown-persistence cases described in the PR.
|
Thanks for the contribution and for addressing the review feedback. Merging now. |
Astro-Han
left a comment
There was a problem hiding this comment.
Approved at @Astro-Han's explicit request: no blocking findings in the automated review of this head, and CI is green.
Summary
The event-wait tests can exhaust their fixed
setImmediatepolling budget before asynchronous Host work reaches the expected checkpoint. In CI this caused the late-authorization and slow-cooldown-persistence tests to fail before their third authorization observation.Give the test helper a 5-second monotonic wall-clock deadline with 5 ms sleeps. The injected observation clock remains fixed, so existing timeout, Retry-After and cancellation assertions retain their exact semantics. A regression test verifies that delayed Host work completes without advancing that clock or firing its timers. Production code is unchanged.
Extracted from #6089 following its scope review, so this test fix can land independently of Write/Edit evidence. Refs #6113.
Failure evidence: https://github.com/apache/maka/actions/runs/39031806684/job/117393589335
Verification
npm ci, full root build, typecheck, lint, format, both desktop/UI Knip checks, ASF headers and whitespace checks passed.AI use
Tool(s) and scope: OpenAI Codex assisted with diagnosis, implementation, tests, extraction, independent agent review and this description. AI review does not replace human review. The commit includes a
Generated-by: OpenAI Codextrailer.Checklist
Does this PR entail a change in behavior?