test(acceptance): 在单窗口验证厂商额度峰值
厂商额度验收此前复用了多图与超大图容量素材,3 Worker 的下载和预处理使 24 个任务跨越多个固定分钟窗口,无法精确证明 RPM 与 TPM 上限。\n\n额度场景固定使用三张正常尺寸引用图并为每个任务增加唯一 URL 变体,使请求满足视频协议且能在单窗口完成;6、9 图和超大图转换继续由独立视频容量 profile 覆盖。\n\n验证:\n- go test ./cmd/acceptance-load ./internal/acceptanceworkload -count=1\n- go vet ./cmd/acceptance-load ./internal/acceptanceworkload\n- gofmt -l cmd/acceptance-load/main.go cmd/acceptance-load/main_test.go
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
)
|
||||
@@ -172,11 +173,34 @@ func TestVideoCombinationsProvide128UniqueInputs(t *testing.T) {
|
||||
if len(seen) != 128 {
|
||||
t.Fatalf("unique combinations=%d", len(seen))
|
||||
}
|
||||
if got := requestedVideoCombinationCount(combinations, 144, 0, 1); got != 131 {
|
||||
if got := requestedVideoCombinationCount(combinations, "video-capacity", 144, 0, 1); got != 131 {
|
||||
t.Fatalf("requested combinations=%d, want 131", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVideoProviderQuotaCombinationsUseDistinctNormalSizedImages(t *testing.T) {
|
||||
images := []string{
|
||||
"https://fixtures.example/image-00.png",
|
||||
"https://fixtures.example/image-01.png",
|
||||
"https://fixtures.example/image-02.png",
|
||||
"https://fixtures.example/image-03.png",
|
||||
}
|
||||
combinations := videoProviderQuotaCombinations(images, 24)
|
||||
if got := requestedVideoCombinationCount(combinations, "video-provider-quota", 24, 0, 1); got != 24 {
|
||||
t.Fatalf("quota combinations=%d, want 24", got)
|
||||
}
|
||||
for _, combination := range combinations {
|
||||
if len(combination) != 3 {
|
||||
t.Fatalf("invalid quota combination: %v", combination)
|
||||
}
|
||||
for _, imageURL := range combination {
|
||||
if !strings.Contains(imageURL, "acceptance_quota_variant=") {
|
||||
t.Fatalf("quota image lacks unique variant: %s", imageURL)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGeminiLoadIsSplitAcrossTwoGatewayAPIs(t *testing.T) {
|
||||
output := paddedPNG(256 << 10)
|
||||
encoded := base64.StdEncoding.EncodeToString(output)
|
||||
|
||||
Reference in New Issue
Block a user