Repository navigation
测试:push-limits CLI 子进程与 Worker 共用固定时钟 - #280
Merged
moshui-claude-code-macmini[bot] merged 1 commit intoOct 12, 2026
Merged
Conversation
device-enrollment-cli 测试里 Worker 用 AIUSAGE_NOW 固定时钟,但 push-limits 的 Python 子进程走 LimitsRuntime 默认 now_provider(真实时钟)。真实时间越过 fixture reset_at(2026-10-11)后两个窗口被判 provider_unavailable,测试从 10-11 起在 main 稳定失败。 测试启动代码在导入 CLI 前把 limits_runtime._default_now 固定为同一个 fixedNow,复用已有 now_provider 注入点;不改产品代码、断言和预期值。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moshui-claude-code-macmini
Bot
deleted the
claude/fix-cli-limits-clock
branch
October 12, 2026 06:48
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.
问题
cloudflare/native-worker/test/device-enrollment-cli.test.ts的「activated device publishes two official windows; other-device failures cannot mask them」从约 2026-10-11 起在 main 上稳定失败(最后绿:2026-10-07)。根因
Worker 侧用
AIUSAGE_NOW='2026-10-04T00:00:00Z'固定时钟,但publishLimits()调用的 Pythonpush-limits子进程走LimitsRuntime默认now_provider(limits_runtime._default_now,真实时钟)。_is_current_official_window要求reset_at > now,真实时间越过 fixturereset_at=2026-10-11后两个窗口被判provider_unavailable,CLI 返回 success=false / 退出码 1,test:160expect(healthy).toBe(false)失败。Python 不读AIUSAGE_NOW。修复
只改测试:抽出共享常量
fixedNow,Worker 绑定与 CLI 子进程共用;CLI 启动代码在导入 CLI 前把_default_now固定为fixedNow,复用已有now_provider注入点。不改产品代码、断言、预期值。证据
2026-10-11T00:00:01Z(越过 reset_at)→ 重新在 :160 变红;已备份还原scripts/verify.sh:Python 795 tests OK(skipped=9);Worker 45 files / 378 tests passed解除对 #279 的阻塞。
🤖 Generated with Claude Code