Repository navigation
test(billing): make peak-rate usage tests independent of wall clock - #8743
Merged
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
跟进 #8742 的 unit 失败。
两个图片 token 计费测试把峰时窗口设为
[00:00, 23:59),却没有传入PricingAt,因此每天 UTC 最后一分钟会合法得到 1 倍费率,仍被测试断言为 3 倍。该 CI 失败发生在23:59:29.905Z。为 OpenAI 和通用网关的两个原测试显式传入 UTC 正午的计费时刻,保留全部倍率、图片 token、成本和扣费断言。
验证:
timezone.Now。原 main 和 fix(gateway): preserve message output config with per-turn beta #8742 的失败用例在日志时刻均复现 expected 3 / actual 1;两个原测试在该时刻均失败、正午均通过,修复后两种时钟均通过。go test -p=1 -tags=unit ./... -count=1 -json:26,879 通过、41 跳过。go test -p=2 -tags=integration ./... -count=1 -json:16,143 通过、16 跳过。git diff --check通过。AI 辅助实现与本地验证。主线 Go 1.27.3 安全检查的工具链修复由 #8670 单独跟踪。