From 8da0322334c1c6a413a2534946fd15e4f460632a Mon Sep 17 00:00:00 2001 From: vincentwschau <99756290+vincentwschau@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:20:57 -0400 Subject: [PATCH] Fix test flakiness due to using inconsistent time. (#2485) (cherry picked from commit 94499523a6b05f5f090ea5a14a5a2deec270a604) --- indexer/services/comlink/__tests__/lib/helpers.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indexer/services/comlink/__tests__/lib/helpers.test.ts b/indexer/services/comlink/__tests__/lib/helpers.test.ts index d814827235..bd342e1754 100644 --- a/indexer/services/comlink/__tests__/lib/helpers.test.ts +++ b/indexer/services/comlink/__tests__/lib/helpers.test.ts @@ -868,7 +868,7 @@ describe('helpers', () => { ), }; const blockHeight2: string = '80'; - const blockTime2: string = DateTime.fromISO(pnlTick.createdAt).plus({ hour: 1 }).toISO(); + const blockTime2: string = DateTime.fromISO(pnlTick.createdAt).startOf('hour').plus({ minute: 61 }).toISO(); const pnlTick3: PnlTicksFromDatabase = { ...testConstants.defaultPnlTick, id: PnlTicksTable.uuid( @@ -880,7 +880,7 @@ describe('helpers', () => { createdAt: blockTime2, }; const blockHeight3: string = '81'; - const blockTime3: string = DateTime.fromISO(pnlTick.createdAt).plus({ minute: 61 }).toISO(); + const blockTime3: string = DateTime.fromISO(pnlTick.createdAt).startOf('hour').plus({ minute: 62 }).toISO(); const pnlTick4: PnlTicksFromDatabase = { ...testConstants.defaultPnlTick, id: PnlTicksTable.uuid(