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

Web3-eth-contract tests update/fixes

Open mconnelly8 opened this issue 1 year ago • 2 comments

--forceExit flag should be removed from the web3-eth-contract tests test:integration

mconnelly8 avatar Sep 03 '24 13:09 mconnelly8

I’m trying to understand the reasoning behind this issue. As I see it, the --forceExit flag is used in tests that rely on a WebSocket provider because the test runner doesn’t exit properly due to hanging socket connections. This could potentially be solved by closing the connection correctly with web3.currentProvider.disconnect().

In the web3-eth-contract package, the integration tests are run by default using the HTTP provider. However, some tests are conditional and only execute with a WebSocket provider. When using the HTTP provider, you’ll notice that 15 tests are skipped.

I’m looking for more context to understand whether I should focus on enabling the WebSocket tests, ensuring proper connection closure, or if there’s a larger issue that I’m missing. Could you please clarify the intended approach?

krzysu avatar Oct 15 '24 13:10 krzysu

related PR: https://github.com/web3/web3.js/pull/7162

jdevcs avatar Oct 15 '24 17:10 jdevcs