diff --git a/e2e/connection-flow.spec.ts b/e2e/connection-flow.spec.ts index 1208b7c..fb39199 100644 --- a/e2e/connection-flow.spec.ts +++ b/e2e/connection-flow.spec.ts @@ -75,7 +75,7 @@ test.describe('E2E-002: Connection Flow Tests', () => { id, name: 'Invalid Key Test', provider: 'pinecone' as const, - apiKey: 'invalid-api-key-12345', + apiKey: 'invalid-api-key-for-tests', // gitleaks:allow } try { diff --git a/e2e/electron.setup.ts b/e2e/electron.setup.ts index 819c5e4..8ddcfa0 100644 --- a/e2e/electron.setup.ts +++ b/e2e/electron.setup.ts @@ -181,7 +181,7 @@ export async function createPineconeTestProfile( ): Promise { const profileId = `test-pinecone-${Date.now()}` const profileName = name || `Test Pinecone ${Date.now()}` - const pineconeKey = apiKey || process.env.PINECONE_API_KEY || 'dummy-key-for-local-testing' + const pineconeKey = apiKey || process.env.PINECONE_API_KEY || 'dummy-key-for-local-testing' // gitleaks:allow await page.evaluate( async ({ id, name, apiKey }) => { diff --git a/e2e/index-collection-management.spec.ts b/e2e/index-collection-management.spec.ts index 69d8990..7c89034 100644 --- a/e2e/index-collection-management.spec.ts +++ b/e2e/index-collection-management.spec.ts @@ -182,16 +182,17 @@ test.describe('E2E-003: Index/Collection Management Tests', () => { await (window as any).electronAPI.pinecone.createIndex(id, params) }, { id: testProfileId, params: createParams }) - // Wait for index to be created and become ready - // Pinecone indexes can take a while to initialize - await page.waitForTimeout(5000) - - // Verify index was created by listing indexes - const indexes = await page.evaluate(async (id) => { - return await (window as any).electronAPI.pinecone.listIndexes(id) - }, testProfileId) + // Poll for index to become ready (can take 30-60+ seconds for serverless) + let createdIndex: any + await expect(async () => { + const indexes = await page.evaluate(async (id) => { + return await (window as any).electronAPI.pinecone.listIndexes(id) + }, testProfileId) + createdIndex = indexes.find((idx: any) => idx.name === testIndexName) + expect(createdIndex).toBeDefined() + expect(createdIndex?.status?.ready).toBe(true) + }).toPass({ timeout: 90000, intervals: [5000] }) - const createdIndex = indexes.find((idx: any) => idx.name === testIndexName) expect(createdIndex).toBeDefined() expect(createdIndex?.dimension).toBe(384) expect(createdIndex?.metric).toBe('cosine')