Skip to content

test(runtime-host): wait for event observation I/O by deadline - #6140

Merged
Astro-Han merged 1 commit into
apache:mainfrom
jackeyfaker77:codex/event-wait-io-deadline
Oct 19, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
jackeyfaker77:codex/event-wait-io-deadline

Conversation

@jackeyfaker77

Copy link
Copy Markdown
Contributor

Summary

The event-wait tests can exhaust their fixed setImmediate polling 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

  • On this standalone branch based on main: clean npm ci, full root build, typecheck, lint, format, both desktop/UI Knip checks, ASF headers and whitespace checks passed.
  • Complete event-wait-manager suite: 251 passed, no failures or skips.
  • For the identical patch originally validated in fix(runtime): guard Write/Edit against content changes before execution #6089: the new regression failed with the old helper; the two original CI failures passed in 10 independent processes (20/20 cases).
  • Independent Codex review found no P0-P2 issues or new P3 suggestions; the reviewer independently passed the regression and both original CI failure cases (3/3). This is AI review, not maintainer approval.
  • Full-monorepo tests and native Linux/macOS execution were not run locally.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

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 Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No (production behavior is unchanged; only test synchronization changes)

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
@github-actions github-actions Bot added the effort/S Under 100 readable lines label Oct 17, 2026
jackeyfaker77 added a commit to jackeyfaker77/maka-agent that referenced this pull request Oct 17, 2026
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 Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. CI test passes, 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.

@Astro-Han

Copy link
Copy Markdown
Contributor

Thanks for the contribution and for addressing the review feedback. Merging now.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at @Astro-Han's explicit request: no blocking findings in the automated review of this head, and CI is green.

@Astro-Han
Astro-Han merged commit a4a5363 into apache:main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants