test(acceptance): 验证厂商三类额度与优先路由
为 provider-burst 固定三平台并发、RPM、TPM 和优先级组合,使用稳定 token 用量的本地视频负载验证同级按容量分流及低优先级溢出。\n\n报告升级为 v2,强制校验三类额度峰值精确命中上限、不越界、队列回收、三 Worker 分发以及重复提交和回调安全。\n\n验证:\n- env -u AI_GATEWAY_TEST_DATABASE_URL go test ./... -count=1\n- go vet ./...\n- bash -n scripts/acceptance/provider-burst.sh scripts/acceptance/run-local-acceptance.sh\n- shellcheck -x scripts/acceptance/provider-burst.sh scripts/acceptance/run-local-acceptance.sh
This commit is contained in:
@@ -242,6 +242,23 @@ func TestVideoCapacityDelay(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestVideoProviderQuotaDelayAndUsage(t *testing.T) {
|
||||
body := map[string]any{
|
||||
"seed": json.Number("5"),
|
||||
"content": []any{map[string]any{
|
||||
"type": "text",
|
||||
"text": "acceptance-provider-quota",
|
||||
}},
|
||||
}
|
||||
delay := videoDelay(body, false)
|
||||
if delay < 5*time.Second || delay > 10*time.Second {
|
||||
t.Fatalf("video provider quota delay=%s, want 5s..10s", delay)
|
||||
}
|
||||
if tokens := videoUsageTokens(body); tokens != 7 {
|
||||
t.Fatalf("video provider quota usage tokens=%d, want 7", tokens)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolcesProtocolAcceptsThreeSixAndNineReferenceImages(t *testing.T) {
|
||||
server := New(Config{Wait: func(context.Context, time.Duration) error { return nil }})
|
||||
httpServer := httptest.NewServer(server.Handler())
|
||||
|
||||
Reference in New Issue
Block a user