From c4fbffb380049c1a355ba9318a47fa32aaa7bb50 Mon Sep 17 00:00:00 2001 From: Lia Date: Fri, 25 Sep 2026 15:01:36 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=B6=20test:=20Isolate=20Marketplace=20?= =?UTF-8?q?Retries=20and=20MCP=20OAuth=20Ownership?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/specs/mock/scenarios/marketplace-recovery.spec.ts | 8 +++++++- .../MCPConnectionFactory.oauthSdk.integration.test.ts | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/e2e/specs/mock/scenarios/marketplace-recovery.spec.ts b/e2e/specs/mock/scenarios/marketplace-recovery.spec.ts index 1382fe7c3d..c147135c3b 100644 --- a/e2e/specs/mock/scenarios/marketplace-recovery.spec.ts +++ b/e2e/specs/mock/scenarios/marketplace-recovery.spec.ts @@ -58,7 +58,13 @@ const makeAgents = (count: number, offset: number): MockAgent[] => const routeMarketplace = async (page: Page, handler: (route: Route) => Promise) => { await page.route('**/api/agents*', async (route) => { const requestUrl = new URL(route.request().url()); - if (route.request().method() !== 'GET' || requestUrl.pathname !== '/api/agents') { + // The agent selector also calls this endpoint and now refreshes on window focus. + // Marketplace always sends its sort; only those requests belong to this fixture. + if ( + route.request().method() !== 'GET' || + requestUrl.pathname !== '/api/agents' || + !requestUrl.searchParams.has('sort') + ) { await route.continue(); return; } diff --git a/packages/api/src/mcp/__tests__/MCPConnectionFactory.oauthSdk.integration.test.ts b/packages/api/src/mcp/__tests__/MCPConnectionFactory.oauthSdk.integration.test.ts index 7b1ef720ec..1b6fead036 100644 --- a/packages/api/src/mcp/__tests__/MCPConnectionFactory.oauthSdk.integration.test.ts +++ b/packages/api/src/mcp/__tests__/MCPConnectionFactory.oauthSdk.integration.test.ts @@ -259,6 +259,7 @@ describe('MCPConnectionFactory OAuth against real SDK Streamable HTTP server', ( const manager = new MCPManager(); jest.spyOn(manager, 'getConnection').mockResolvedValue(connection); const registrySpy = jest.spyOn(MCPServersRegistry, 'getInstance').mockReturnValue({ + isAppServerConfig: jest.fn().mockResolvedValue(false), resolveAllowlists: jest.fn().mockResolvedValue({ allowedDomains: null, allowedAddresses: null,