Skip to content

test(objectql): de-flake hook-binder fire-and-forget assertion (#2744) - #2749

Merged
os-zhuang merged 1 commit into
mainfrom
fix/2744-hook-binder-flaky
Jul 10, 2026
Merged

test(objectql): de-flake hook-binder fire-and-forget assertion (#2744)#2749
os-zhuang merged 1 commit into
mainfrom
fix/2744-hook-binder-flaky

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Closes #2744

hook-binder.test.ts 的 fire-and-forget 用例用墙钟阈值(<20ms)证明"未 await handler",共享 CI runner 慢一点就随机红(PR #2742 实测 23ms,重跑即绿)。改为顺序性断言:wrapper resolve 后同步检查 calls 仍为空——handler 的 30ms timer 是宏任务,不可能在 wrapper 的 promise 链与同步断言之间触发,与机器快慢无关;而 wrapper 若真 await 了 handler,calls 此处必然已是 ['done'],照样红。测试后半段(60ms 后 ['done'])不变。

纯测试改动;vitest run src/hook-binder.test.ts 15/15 ✓。

🤖 Generated with Claude Code

…tion instead of wall clock (#2744)

The test asserted the wrapped after-event call returned in <20ms; shared
CI runners exceed that (observed 23ms on PR #2742), failing an unrelated
PR. Replace with an ordering assertion: right after the wrapper resolves,
the handler's side effect must not have happened yet — the handler's 30ms
timer is a macrotask and cannot fire between the wrapper's resolution and
the synchronous check, so this is deterministic regardless of runner
speed, while still failing if the wrapper ever starts awaiting the
handler (calls would already hold 'done').

Closes #2744.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 10, 2026 8:21am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql.

13 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via @objectstack/objectql)
  • content/docs/data-modeling/formulas.mdx (via packages/objectql)
  • content/docs/deployment/migration-from-objectql.mdx (via @objectstack/objectql)
  • content/docs/deployment/vercel.mdx (via @objectstack/objectql)
  • content/docs/kernel/services-checklist.mdx (via @objectstack/objectql)
  • content/docs/kernel/services.mdx (via @objectstack/objectql)
  • content/docs/permissions/authentication.mdx (via @objectstack/objectql)
  • content/docs/plugins/index.mdx (via @objectstack/objectql)
  • content/docs/plugins/packages.mdx (via @objectstack/objectql)
  • content/docs/protocol/objectos/index.mdx (via @objectstack/objectql)
  • content/docs/protocol/objectql/state-machine.mdx (via @objectstack/objectql)
  • content/docs/releases/implementation-status.mdx (via @objectstack/objectql)
  • content/docs/releases/v9.mdx (via @objectstack/objectql)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 4ea6962 into main Jul 10, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the fix/2744-hook-binder-flaky branch July 10, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[objectql] flaky wall-clock assertion in hook-binder fire-and-forget test (<20ms on shared CI runner)

1 participant