fix(acceptance): 解除八任务准入瓶颈

线上 P24 验收证明 Worker 注册容量为 48,但异步 admission 始终只有 8 条活跃租约。将单事务调度窗口覆盖当前 2 x P32 的 64 槽,避免多 Worker 在同一 FIFO 小批次上竞争形成隐性全局上限。\n\nGemini 流式请求补充可回放 GetBody 与精确 Content-Length,使带幂等键的 POST 遇到 HTTP/2 可重试传输错误时可安全重放;同时提前部署验收回调收集器,保证旧 Run side effects 能在接管前收口。\n\n已通过 Go 全量测试、go vet、gofmt、Shell bash -n、ShellCheck、验收与人工发布脚本测试、迁移安全检查,以及独立 PostgreSQL 48 条 admission/租约/River job 原子集成测试。
This commit is contained in:
2026-08-01 16:59:28 +08:00
parent 7623449e33
commit 215b6b607f
7 changed files with 105 additions and 27 deletions
+32
View File
@@ -8,6 +8,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/http/httptest"
"os"
@@ -82,6 +83,37 @@ func TestStreamGeminiRequestBodyPreservesInput(t *testing.T) {
}
}
func TestGeminiRequestBodyCanBeReplayedAfterHTTP2Failure(t *testing.T) {
input := paddedPNGVariant(256<<10, 91)
request, err := newGeminiRequest(t.Context(), "https://gateway.example/v1beta/models/test:generateContent", input)
if err != nil {
t.Fatalf("new Gemini request: %v", err)
}
if request.GetBody == nil {
t.Fatal("streaming Gemini request does not provide GetBody")
}
first, err := io.ReadAll(request.Body)
if err != nil {
t.Fatalf("read first request body: %v", err)
}
_ = request.Body.Close()
replayedBody, err := request.GetBody()
if err != nil {
t.Fatalf("replay Gemini request body: %v", err)
}
replayed, err := io.ReadAll(replayedBody)
if err != nil {
t.Fatalf("read replayed request body: %v", err)
}
_ = replayedBody.Close()
if !bytes.Equal(first, replayed) {
t.Fatal("replayed Gemini request body differs from the original")
}
if request.ContentLength != int64(len(first)) {
t.Fatalf("content length=%d, want %d", request.ContentLength, len(first))
}
}
func TestVideoCombinationsProvide128UniqueInputs(t *testing.T) {
images := make([]string, 16)
for index := range images {