Skip to content

Commit

Permalink
Slows down block maintenance iteration (#543)
Browse files Browse the repository at this point in the history
* Slows down block maintenance iteration

* Fixes unstable integration test.
  • Loading branch information
benbierens authored Sep 4, 2023
1 parent 37b3d99 commit 545e0d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions codex/stores/maintenance.nim
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ proc new*(
clock: Clock = SystemClock.new()
): BlockMaintainer =
## Create new BlockMaintainer instance
##
##
## Call `start` to begin looking for for expired blocks
##
##
BlockMaintainer(
repoStore: repoStore,
interval: interval,
Expand Down Expand Up @@ -78,6 +78,7 @@ proc runBlockCheck(self: BlockMaintainer): Future[void] {.async.} =
if be =? await maybeBeFuture:
inc numberReceived
await self.processBlockExpiration(be)
await sleepAsync(50.millis)

# 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.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/testblockexpiration.nim
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ethersuite "Node block expiration tests":

let contentId = uploadTestFile()

await sleepAsync(2.seconds)
await sleepAsync(3.seconds)

expect TimeoutError:
discard downloadTestFile(contentId)

0 comments on commit 545e0d4

Please sign in to comment.