From 838c2cab885c6a0923b152ec07b3b704ed60d258 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Wed, 3 Jun 2026 20:05:57 -0300 Subject: [PATCH] test(sse-auth): unique default apiKey per seeded connection (align with #3023 dedup) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After #3100 (#3023) dedups provider connections by decrypted key value, the seedConnection helper's shared 'sk-test' default collapsed multiple seeded connections into one, breaking round-robin / least-used / fallback selection tests (they saw 1 account instead of 2+). Default to a unique key per connection (matching the existing unique-name default). Found via full test:unit — #3100 was merged via gh, bypassing the pre-push test gate, so these never ran post-merge. --- tests/unit/sse-auth.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/sse-auth.test.ts b/tests/unit/sse-auth.test.ts index b89dbba18d..50576acc75 100644 --- a/tests/unit/sse-auth.test.ts +++ b/tests/unit/sse-auth.test.ts @@ -33,7 +33,11 @@ async function seedConnection(provider: string, overrides: any = {}) { authType: overrides.authType || "apikey", name: overrides.name || `${provider}-${Math.random().toString(16).slice(2, 8)}`, email: overrides.email, - apiKey: overrides.apiKey || "sk-test", + // Unique per connection by default — real accounts have distinct keys, and + // createProviderConnection dedups by decrypted key value (#3023), so a shared + // default would collapse multiple seeded connections into one and break + // round-robin / least-used / fallback selection tests. + apiKey: overrides.apiKey || `sk-test-${Math.random().toString(16).slice(2, 10)}`, accessToken: overrides.accessToken, refreshToken: overrides.refreshToken, isActive: overrides.isActive ?? true,