Slows down block maintenance iteration (#543)

* Slows down block maintenance iteration

* Fixes unstable integration test.
This commit is contained in:
Ben Bierens 2023-09-04 11:12:14 +02:00 committed by GitHub
parent 37b3d99c3d
commit 545e0d47e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -42,9 +42,9 @@ proc new*(
clock: Clock = SystemClock.new() clock: Clock = SystemClock.new()
): BlockMaintainer = ): BlockMaintainer =
## Create new BlockMaintainer instance ## Create new BlockMaintainer instance
## ##
## Call `start` to begin looking for for expired blocks ## Call `start` to begin looking for for expired blocks
## ##
BlockMaintainer( BlockMaintainer(
repoStore: repoStore, repoStore: repoStore,
interval: interval, interval: interval,
@ -78,6 +78,7 @@ proc runBlockCheck(self: BlockMaintainer): Future[void] {.async.} =
if be =? await maybeBeFuture: if be =? await maybeBeFuture:
inc numberReceived inc numberReceived
await self.processBlockExpiration(be) await self.processBlockExpiration(be)
await sleepAsync(50.millis)
# If we received fewer blockExpirations from the iterator than we asked for, # If we received fewer blockExpirations from the iterator than we asked for,
# We're at the end of the dataset and should start from 0 next time. # We're at the end of the dataset and should start from 0 next time.

View File

@ -65,7 +65,7 @@ ethersuite "Node block expiration tests":
let contentId = uploadTestFile() let contentId = uploadTestFile()
await sleepAsync(2.seconds) await sleepAsync(3.seconds)
expect TimeoutError: expect TimeoutError:
discard downloadTestFile(contentId) discard downloadTestFile(contentId)