web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

At some edge case in reject_if_block_timeout, an interval may not be cleared

Open Muhammad-Altabba opened this issue 1 year ago • 0 comments
trafficstars

Description

At some edge case, an interval may not be cleared leading to process not be able to finish. The following line is not called in some edge cases: https://github.com/web3/web3.js/blob/f7d9349d92163254146cd61b1e38a78edaab2d24/packages/web3-eth/src/utils/reject_if_block_timeout.ts#L58

Steps to reproduce the behavior

  1. Run: cd packages/web3-eth && yarn test watch_transaction_by_subscription.test.ts
  2. The test will pass, but you will receive a warning: A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.

Muhammad-Altabba avatar Dec 15 '23 16:12 Muhammad-Altabba