Skip to content

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

Description

@os-zhuang

`packages/objectql/src/hook-binder.test.ts` → "runs async after-events fire-and-forget" 断言 wrapped 调用在 <20ms 内返回(`expect(Date.now() - t0).toBeLessThan(20)`,line ~224)。共享 CI runner 慢一点就红:

AssertionError: expected 23 to be less than 20

实测在 PR #2742 的 Test Core 上随机命中(该 PR 未触碰 objectql),重跑即绿=典型 timing flake。

建议:别用墙钟阈值证明 fire-and-forget——改为顺序性断言(调用返回时 handler 尚未执行:返回后立刻检查 `calls` 为空,再 await 之后为 `['done']`——测试后半段已有),或把阈值放宽到与语义匹配的量级(如 <500ms,阈值只为挡"意外变同步 await 60ms+")。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions