mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(tests): update quota exhaustion thresholds
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user