From 017d08d45e7b42bbeb974ea020b0e4f869d4b5fc Mon Sep 17 00:00:00 2001 From: dalamudx Date: Wed, 30 Sep 2026 02:19:15 +0800 Subject: [PATCH] =?UTF-8?q?test(claude-code):=20=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E6=B5=8B=E8=AF=95=E5=85=BC=E5=AE=B9=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E5=90=8E=E5=BC=82=E6=AD=A5=E9=A2=9D=E5=BA=A6=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/tests/control/admin/oauth.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/aether-gateway/src/tests/control/admin/oauth.rs b/apps/aether-gateway/src/tests/control/admin/oauth.rs index fea3ca978..5d307c626 100644 --- a/apps/aether-gateway/src/tests/control/admin/oauth.rs +++ b/apps/aether-gateway/src/tests/control/admin/oauth.rs @@ -410,6 +410,10 @@ async fn gateway_authorizes_claude_cookie_without_persisting_cookie_impl() { "email_address": "claude@example.com" } }), + // Newly authorized accounts get their 5H/weekly quota fetched right away. + quota if quota.starts_with("claude-code-quota:") => { + json!({"five_hour": {"utilization": 10.0}}) + } unexpected => panic!("unexpected execution plan: {unexpected}"), }; Json(json!({ @@ -811,7 +815,15 @@ async fn gateway_batch_authorizes_claude_cookies_as_redacted_task_impl() { } let plans = execution_plans.lock().expect("mutex should lock"); - assert_eq!(plans.len(), 6); + // Post-authorization quota refreshes are fire-and-forget, so their count is not + // deterministic here; only the OAuth flow plans are asserted. + assert_eq!( + plans + .iter() + .filter(|plan| !plan.request_id.starts_with("claude-code-quota:")) + .count(), + 6 + ); assert_eq!( plans .iter()