Skip to content

Commit 3695a03

Browse files
committed
[ci] fix integration test
Signed-off-by: Itai Segall <[email protected]>
1 parent b8280be commit 3695a03

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/ScanTimeBasedIntegrationTest.scala

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,24 @@ class ScanTimeBasedIntegrationTest
446446
}
447447
}
448448

449-
val snapshotBefore = sv1ScanBackend.getDateOfMostRecentSnapshotBefore(
450-
getLedgerTime,
451-
migrationId,
449+
val startTime = getLedgerTime
450+
451+
advanceTime(
452+
java.time.Duration
453+
.ofHours(sv1ScanBackend.config.acsSnapshotPeriodHours.toLong)
454+
.plusSeconds(1L)
452455
)
453456

457+
val snapshot1 = eventually() {
458+
val snapshot1 = sv1ScanBackend.getDateOfMostRecentSnapshotBefore(
459+
getLedgerTime,
460+
migrationId,
461+
)
462+
snapshot1 should not be None
463+
snapshot1.value shouldBe > (startTime)
464+
snapshot1
465+
}
466+
454467
createAnsEntry(
455468
aliceAnsExternalClient,
456469
perTestCaseName("snapshot"),
@@ -469,14 +482,12 @@ class ScanTimeBasedIntegrationTest
469482
getLedgerTime,
470483
migrationId,
471484
)
472-
snapshotBefore should not(be(snapshotAfter))
485+
snapshot1 should not(be(snapshotAfter))
473486
snapshotAfter
474487
}
475488

476-
sv1ScanBackend.getDateOfFirstSnapshotAfter(CantonTimestamp.MinValue, 0) should not be None
477-
sv1ScanBackend.getDateOfFirstSnapshotAfter(CantonTimestamp.MinValue, 0).value shouldBe snapshotBefore.value
478-
sv1ScanBackend.getDateOfFirstSnapshotAfter(CantonTimestamp.tryFromInstant(snapshotBefore.value.toInstant), 0) should not be None
479-
sv1ScanBackend.getDateOfFirstSnapshotAfter(CantonTimestamp.tryFromInstant(snapshotBefore.value.toInstant), 0).value shouldBe snapshotAfter.value
489+
sv1ScanBackend.getDateOfFirstSnapshotAfter(startTime, 0).value shouldBe snapshot1.value
490+
sv1ScanBackend.getDateOfFirstSnapshotAfter(CantonTimestamp.tryFromInstant(snapshot1.value.toInstant), 0).value shouldBe snapshotAfter.value
480491

481492
val snapshotAfterData = sv1ScanBackend.getAcsSnapshotAt(
482493
CantonTimestamp.assertFromInstant(snapshotAfter.value.toInstant),

0 commit comments

Comments
 (0)