fix: correctly close ws connection in web3-eth-contract integration tests#7338
fix: correctly close ws connection in web3-eth-contract integration tests#7338
Conversation
Bundle StatsHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: d238442 | Previous: efac906 | Ratio |
|---|---|---|---|
processingTx |
22426 ops/sec (±8.47%) |
23741 ops/sec (±5.98%) |
1.06 |
processingContractDeploy |
42533 ops/sec (±7.07%) |
39369 ops/sec (±11.37%) |
0.93 |
processingContractMethodSend |
16981 ops/sec (±7.27%) |
17405 ops/sec (±6.68%) |
1.02 |
processingContractMethodCall |
28505 ops/sec (±7.48%) |
28770 ops/sec (±6.60%) |
1.01 |
abiEncode |
46333 ops/sec (±6.92%) |
44377 ops/sec (±8.86%) |
0.96 |
abiDecode |
31041 ops/sec (±8.09%) |
31118 ops/sec (±7.50%) |
1.00 |
sign |
1595 ops/sec (±0.49%) |
1604 ops/sec (±0.56%) |
1.01 |
verify |
364 ops/sec (±2.97%) |
369 ops/sec (±2.79%) |
1.01 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.x #7338 +/- ##
=======================================
Coverage 94.51% 94.51%
=======================================
Files 218 218
Lines 8557 8557
Branches 2363 2363
=======================================
Hits 8088 8088
Misses 469 469
Flags with carried forward coverage won't be shown. Click here to find out more. |
fe60f0c to
f0c36ff
Compare
f0c36ff to
7633c3c
Compare
7633c3c to
e9afeb5
Compare
e9afeb5 to
f2e11d6
Compare
f2e11d6 to
1100490
Compare
1100490 to
fa3f764
Compare
95f4f29 to
53cb976
Compare
a2f3782 to
6433db8
Compare
| export const createLocalAccount = async (web3: Web3) => { | ||
| const account = web3.eth.accounts.create(); | ||
| await refillAccount((await createTempAccount()).address, account.address, '10000000000000000'); | ||
| await refillAccount((await createTempAccount()).address, account.address, '100000000000000000'); |
There was a problem hiding this comment.
increase refill amount as often tests are failing because of not enough funds
| (web3Context.provider as unknown as Web3BaseProvider).disconnect(); | ||
|
|
||
| await new Promise(resolve => { | ||
| setTimeout(resolve, 1000); |
There was a problem hiding this comment.
why to wait for 1s on each closeOpenConnection close?
scripts/geth.sh
Outdated
| npx wait-port -t 10000 "$WEB3_SYSTEM_TEST_PORT" | ||
| echo "docker run -d -p 3333:3333 ethereum/client-go:v1.13.14-amd64 --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 3333 --http --http.addr 0.0.0.0 --http.port 3334 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev" | ||
| docker run -d -p 3333:3333 ethereum/client-go:v1.13.14-amd64 --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 3333 --http --http.addr 0.0.0.0 --http.port 3333 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev | ||
| echo "docker run -d -p 3333:3333 ethereum/client-go:v1.14.10-amd64 --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 3333 --http --http.addr 0.0.0.0 --http.port 3334 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev" |
There was a problem hiding this comment.
upgrade geth to the latest versioned amd64 release I found, shall we just use the latest tag (client-go:latest-amd64)?
more: https://hub.docker.com/r/ethereum/client-go/tags
|
With the upgraded version of Geth, some new errors have started to appear. For example, see: this build https://github.com/web3/web3.js/actions/runs/11702836716/job/32591923473 |
scripts/system_tests_utils.ts
Outdated
| const url = getSystemTestProviderUrl(); | ||
| const web3 = new Web3(url); | ||
| web3.registerPlugin(new HardhatPlugin()); | ||
| // eslint-disable-next-line |
There was a problem hiding this comment.
I'll suggest to specify and disable exact lint error
There was a problem hiding this comment.
and for above instances as well
pls see this in detail and open issue in geth, |
|
PR looks good to me |
Description
Correctly close ws connection in web3-eth-contract integration tests
Fixes #7231
Type of change
Checklist:
npm run lintwith success and extended the tests and types if necessary.npm run test:unitwith success.npm run test:coverageand my test cases cover all the lines and branches of the added code.npm run buildand testeddist/web3.min.jsin a browser.CHANGELOG.mdfile in the root folder.