fix(ci): 等待部署 smoke 请求结算 - #286
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 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.
Summary
修复 Personal Deploy 的 smoke 验证在请求返回后立即删除测试 upstream,导致异步 billing snapshot 写入触发 upstream 外键错误的问题。
Related Issue
无。
Type of Change
Root Cause
代理请求返回并不代表 request log 与 billing snapshot 已经完成异步结算。原 smoke 脚本在收到 completion 与 stream 响应后直接进入
finally,删除测试 upstream;随后 billing snapshot 写入使用已删除的upstream_id,触发外键错误。Changes
status_code且billing_status字段已经出现,最多等待 30 秒,每 250ms 重试。finally仍执行 API Key、upstream 和 mock server 的 best-effort cleanup。Test Plan
pnpm exec prettier --check .github/workflows/deploy-personal.yml:通过。git diff --check:通过。Additional Notes
该修复只改变部署 smoke 的资源生命周期等待边界,不改变正常请求行为。