From 0627b7c071a754aa6473914b600a7ff8d78261f1 Mon Sep 17 00:00:00 2001 From: John Watson Date: Tue, 4 Nov 2025 19:06:19 +0000 Subject: [PATCH 1/2] fix: re-anble onfailure marker for luminork tests --- .github/workflows/run-api-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-api-test.yml b/.github/workflows/run-api-test.yml index c67000b14e..9265a95bdc 100644 --- a/.github/workflows/run-api-test.yml +++ b/.github/workflows/run-api-test.yml @@ -220,7 +220,7 @@ jobs: runs-on: ubuntu-latest needs: - api-test - # - luminork-api-test + - luminork-api-test environment: ${{ inputs.environment }} if: failure() steps: From 129d5788f3a581a989c6021a7fe605b0395d79ee Mon Sep 17 00:00:00 2001 From: John Watson Date: Tue, 4 Nov 2025 19:20:11 +0000 Subject: [PATCH 2/2] fixup: add some resiliency to the test failing due to 202 --- .../tests/schemas.test.ts | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/bin/si-luminork-api-tests/tests/schemas.test.ts b/bin/si-luminork-api-tests/tests/schemas.test.ts index 726b2d7a60..cd9beb7b06 100644 --- a/bin/si-luminork-api-tests/tests/schemas.test.ts +++ b/bin/si-luminork-api-tests/tests/schemas.test.ts @@ -233,12 +233,32 @@ Deno.test('Schemas API - List and Find Schemas', async () => { ) { const variantId = getSchemaResponse.data.variantIds[0]; - const getVariantResponse = await api.schemas.getSchemaVariant( - config.workspaceId, - changeSetId, - firstSchema.schemaId, - variantId, - ); + // Retry logic for handling 202 responses + let getVariantResponse; + let attempts = 0; + const maxAttempts = 5; + const retryDelayMs = 1000; // 1 second + + do { + getVariantResponse = await api.schemas.getSchemaVariant( + config.workspaceId, + changeSetId, + firstSchema.schemaId, + variantId, + ); + + if (getVariantResponse.status === 200) { + break; + } else if (getVariantResponse.status === 202) { + attempts++; + if (attempts < maxAttempts) { + console.log(`Got 202 response, retrying in ${retryDelayMs}ms (attempt ${attempts}/${maxAttempts})`); + await new Promise(resolve => setTimeout(resolve, retryDelayMs)); + } + } else { + break; // Exit on unexpected status codes + } + } while (getVariantResponse.status === 202 && attempts < maxAttempts); assertEquals(getVariantResponse.status, 200); assertEquals(getVariantResponse.data.variantId, variantId);