web3.js
web3.js copied to clipboard
At some edge case in reject_if_block_timeout, an interval may not be cleared
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
- Run:
cd packages/web3-eth && yarn test watch_transaction_by_subscription.test.ts - 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.