fix(tests): update quota exhaustion thresholds

This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-05-01 20:23:31 -03:00
parent 7ec572ca47
commit 399a911675
2 changed files with 5 additions and 5 deletions

View File

@@ -82,9 +82,9 @@ test("preflightQuota warns but proceeds when usage is above the warning threshol
test("preflightQuota blocks when usage reaches the exhaustion threshold", async () => {
const infos = [];
registerQuotaFetcher("provider-exhausted", async () => ({
used: 95,
used: 99,
total: 100,
percentUsed: 0.95,
percentUsed: 0.99,
}));
const result = await withPatchedConsole(
@@ -101,7 +101,7 @@ test("preflightQuota blocks when usage reaches the exhaustion threshold", async
assert.deepEqual(result, {
proceed: false,
reason: "quota_exhausted",
quotaPercent: 0.95,
quotaPercent: 0.99,
resetAt: null,
});
assert.equal(infos.length, 1);

View File

@@ -169,9 +169,9 @@ test("getProviderCredentialsWithQuotaPreflight skips exhausted preflight account
const quotaPreflight = await import("../../open-sse/services/quotaPreflight.ts");
quotaPreflight.registerQuotaFetcher("openai", async (connectionId) => ({
used: connectionId === blocked.id ? 96 : 40,
used: connectionId === blocked.id ? 99 : 40,
total: 100,
percentUsed: connectionId === blocked.id ? 0.96 : 0.4,
percentUsed: connectionId === blocked.id ? 0.99 : 0.4,
}));
const selected = await auth.getProviderCredentialsWithQuotaPreflight("openai");