OpenZeppelin Test Helpers: Timeout issues when advancing blocks in tests

Hi,

I have a time of 2 mins in my truffle config and I am trying to advance 1 hour worth of blocks with advanceBlockTo but my test keeps getting timed out actually ideally I want to advance to a week worth of blocks but even advancing 1 hour fails what is the workaround for this?

Thanks,
Viraz

1 Like

Hello @viraj124! It’s not recommended to use advanceBlockTo for too many blocks since it will mine block by block. Try using increaseTo instead.

1 Like

@martriay but increase to only increases time not blocks and my contract logic is based on blocks

1 Like

Ah I see. There’s nothing to do then, you will have to use advanceBlock. Is it failing or is it stalling? Do you have any errors to share? It should only be slow.

1 Like

@martriay I am using advanceBlockTo since advance block only forwards 1 block, I have a 2 min time out and with advance Block To I am trying to advance 1 hour/1 week worth of blocks but get a timeout issue

1 Like

There’s not much to do regarding the time it takes, maybe increasing your timeout tolerance?
How much time does it usually take until it fails? What’s the threshold at which it does not timeout?

1 Like