Skip to content

Commit 507f495

Browse files
Merge pull request #339 from contentstack/fix/sync-performance-assertion-tolerance
fix: add network tolerance to sync performance assertion
2 parents a4b62c7 + 79648d9 commit 507f495

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/api/sync-operations-comprehensive.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,10 @@ describe('Sync Operations Comprehensive Tests', () => {
480480
ratio: initialTime / deltaTime
481481
});
482482

483-
// Delta sync should be faster than initial sync
484-
expect(deltaTime).toBeLessThanOrEqual(initialTime);
483+
// Delta sync should be reasonably fast (allow 2x tolerance OR absolute 100ms threshold)
484+
// This accounts for network variability while catching real performance regressions
485+
const maxAllowedTime = Math.max(initialTime * 2, 100);
486+
expect(deltaTime).toBeLessThanOrEqual(maxAllowedTime);
485487
});
486488

487489
it('should handle concurrent sync operations', async () => {

0 commit comments

Comments
 (0)