Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-api-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- api-test
# - luminork-api-test
- luminork-api-test
environment: ${{ inputs.environment }}
if: failure()
steps:
Expand Down
32 changes: 26 additions & 6 deletions bin/si-luminork-api-tests/tests/schemas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Copy Markdown
Contributor

@nickgerace nickgerace Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, TIL about this syntax with do and while combined.


assertEquals(getVariantResponse.status, 200);
assertEquals(getVariantResponse.data.variantId, variantId);
Expand Down
Loading