Update timeout within test to avoid UPSERT error

This commit is contained in:
2025-07-02 20:34:29 -04:00
parent 53632fe470
commit 7f453157ee

View File

@@ -156,10 +156,8 @@ describe.each(repositoryImplementations)('$name', (holder) => {
intervalMs: 500
};
// Non-existent structure
expect(await repository.getHistoricalAveragesOfParkingStructureCounts("non-existent", options)).toEqual([]);
// Structure with no historical data
await repository.addOrUpdateParkingStructure(testStructure);
expect(await repository.getHistoricalAveragesOfParkingStructureCounts(testStructure.id, options)).toEqual([]);
});
@@ -179,7 +177,7 @@ describe.each(repositoryImplementations)('$name', (holder) => {
// Add updates with small delays to ensure different timestamps
for (let i = 0; i < updates.length; i++) {
await repository.addOrUpdateParkingStructure(updates[i]);
await new Promise(resolve => setTimeout(resolve, 10)); // Small delay
await new Promise(resolve => setTimeout(resolve, 100)); // Small delay
}
const now = Date.now();