Skip to content

Commit 01f7bbb

Browse files
authored
fix(integration): retry download after upload to handle API delay (#346)
1 parent 7373802 commit 01f7bbb

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

tests/integration/shared/data-fabric/attachment.integration.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, it, expect } from 'vitest';
22
import { setupUnifiedTests, getServices, InitMode } from '../../config/unified-setup';
3+
import { retryWithBackoff } from '../../utils/helpers';
34

45
/**
56
* Integration tests for entity attachment operations (upload, remove)
@@ -157,10 +158,12 @@ describe.skipIf(!hasAttachmentConfig).each(modes)(
157158
file,
158159
);
159160

160-
// Now download the attachment
161-
const downloadedFile = await entity.downloadAttachment(
162-
ATTACHMENT_CONFIG.recordId,
163-
ATTACHMENT_CONFIG.fieldName,
161+
// Retry download to handle API propagation delay after upload
162+
const downloadedFile = await retryWithBackoff(() =>
163+
entity.downloadAttachment(
164+
ATTACHMENT_CONFIG.recordId,
165+
ATTACHMENT_CONFIG.fieldName,
166+
)
164167
);
165168

166169
expect(downloadedFile).toBeDefined();

0 commit comments

Comments
 (0)