Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stress Tests 1 - QA Tests #6595

Merged
merged 36 commits into from
Nov 28, 2023
Merged

Stress Tests 1 - QA Tests #6595

merged 36 commits into from
Nov 28, 2023

Conversation

avkos
Copy link
Contributor

@avkos avkos commented Nov 14, 2023

Description

Please include a summary of the changes and be sure to follow our Contribution Guidelines.

Fixes #5562

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run lint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:coverage and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have linked Issue(s) with this PR in "Linked Issues" menu.

Copy link

github-actions bot commented Nov 14, 2023

Bundle Stats

Hey 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

Asset Old size New size Diff Diff %
Total 589 KB 589 KB 0 0.00%
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset Old size New size Diff Diff %
web3.min.js 572 KB 572 KB 0 0.00%
../lib/commonjs/index.d.ts 8.63 KB 8.63 KB 0 0.00%
../lib/commonjs/accounts.d.ts 3.89 KB 3.89 KB 0 0.00%
../lib/commonjs/types.d.ts 2.45 KB 2.45 KB 0 0.00%
../lib/commonjs/web3.d.ts 1.14 KB 1.14 KB 0 0.00%
../lib/commonjs/abi.d.ts 1000 bytes 1000 bytes 0 0.00%
../lib/commonjs/eth.exports.d.ts 280 bytes 280 bytes 0 0.00%
../lib/commonjs/providers.exports.d.ts 148 bytes 148 bytes 0 0.00%
../lib/commonjs/version.d.ts 60 bytes 60 bytes 0 0.00%

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #6595 (bd18b4a) into 4.x (3bda14d) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##              4.x    #6595   +/-   ##
=======================================
  Coverage   89.36%   89.36%           
=======================================
  Files         215      215           
  Lines        8309     8309           
  Branches     2248     2248           
=======================================
  Hits         7425     7425           
  Misses        884      884           
Flag Coverage Δ
UnitTests 89.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
web3 ∅ <ø> (∅)
web3-core ∅ <ø> (∅)
web3-errors ∅ <ø> (∅)
web3-eth ∅ <ø> (∅)
web3-eth-abi ∅ <ø> (∅)
web3-eth-accounts ∅ <ø> (∅)
web3-eth-contract ∅ <ø> (∅)
web3-eth-ens ∅ <ø> (∅)
web3-eth-iban ∅ <ø> (∅)
web3-eth-personal ∅ <ø> (∅)
web3-net ∅ <ø> (∅)
web3-providers-http ∅ <ø> (∅)
web3-providers-ipc ∅ <ø> (∅)
web3-providers-ws ∅ <ø> (∅)
web3-rpc-methods ∅ <ø> (∅)
web3-utils ∅ <ø> (∅)
web3-validator ∅ <ø> (∅)

Copy link

cloudflare-workers-and-pages bot commented Nov 14, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: bd18b4a
Status: ✅  Deploy successful!
Preview URL: https://4cc5ab84.web3-js-docs.pages.dev
Branch Preview URL: https://ok-5562-stress-tests-1---qa.web3-js-docs.pages.dev

View logs

@avkos
Copy link
Contributor Author

avkos commented Nov 14, 2023

yarn test:stress:requests
yarn run v1.22.19
$ packages/web3/test/stress/startRequests.sh
Starting geth...
geth --ipcpath /ipc.ipc --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 8545 --http --http.addr 0.0.0.0 --http.port 8545 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev --mine --dev.period=0 --dev.gaslimit 9000000000000000 --rpc.txfeecap=1000000 &>/dev/null &
Waiting for geth...
Waiting for localhost:8545.
Connected!
Start test with provider: ws://127.0.0.1:8545
Prepare 1000 accounts in parallel
Deploy 1000 contracts in parallel
Subscribe to 1000 contracts events
Send data from 1000 accounts in parallel
Get data from 1000 accounts in parallel
Starting geth...
geth --ipcpath /ipc.ipc --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 8545 --http --http.addr 0.0.0.0 --http.port 8545 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev --mine --dev.period=0 --dev.gaslimit 9000000000000000 --rpc.txfeecap=1000000 &>/dev/null &
Waiting for geth...
Waiting for localhost:8545.
Connected!
Start test with provider: http://127.0.0.1:8545
Prepare 100 accounts in parallel
Deploy 100 contracts in parallel
Send data from 100 accounts in parallel
Get data from 100 accounts in parallel
Stopping geth ...
✨  Done in 27.96s.

@avkos avkos changed the title Many requests stress tests Stress Tests 1 - QA Tests Nov 14, 2023
@avkos
Copy link
Contributor Author

avkos commented Nov 21, 2023

yarn test:e2e:manual:geth:ws:chrome

image

yarn test:manual

image

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@avkos
Copy link
Contributor Author

avkos commented Nov 27, 2023

alexeykosinski@mac web3.js % yarn test:stress
yarn run v1.22.19
$ yarn test:stress:geth:ws && yarn test:stress:geth:http && yarn test:stress:geth:ipc && yarn test:e2e:stress:geth:ws:chrome
$ ./scripts/test-runner.sh geth-manual ws node manual
Node software used for tests:  geth-manual
Node running on:  ws://127.0.0.1:8545
$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh manualStart 1
Starting manual geth...
geth --ipcpath /Users/alexeykosinski/work/chainsafe/web3.js/tmp/ipc.ipc --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 8545 --http --http.addr 0.0.0.0 --http.port 8545 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev --mine --dev.period=0 --dev.gaslimit 9000000000000000 --rpc.txfeecap=1000000 &>/dev/null &
Waiting for geth...
Waiting for localhost:8545.
Connected!
$ node ./scripts/gen_accounts.js
$ lerna run test:integration:stress --stream
lerna notice cli v6.6.2
lerna info versioning independent

> web3:"test:integration:stress"

web3: $ jest --config=./test/stress/jest.config.js --forceExit
web3:  PASS  test/stress/validation.test.ts
web3:  PASS  test/stress/data.test.ts
web3:  PASS  test/stress/requests.test.ts
web3: Test Suites: 3 passed, 3 total
web3: Tests:       9 passed, 9 total
web3: Snapshots:   0 total
web3: Time:        5.093 s, estimated 6 s
web3: Ran all test suites.
web3: Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  Lerna (powered by Nx)   Successfully ran target test:integration:stress for project web3


$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh stop
Stopping geth ...
$ ./scripts/test-runner.sh geth-manual http node manual
Node software used for tests:  geth-manual
Node running on:  http://127.0.0.1:8545
$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh manualStart 1
Starting manual geth...
geth --ipcpath /Users/alexeykosinski/work/chainsafe/web3.js/tmp/ipc.ipc --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 8545 --http --http.addr 0.0.0.0 --http.port 8545 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev --mine --dev.period=0 --dev.gaslimit 9000000000000000 --rpc.txfeecap=1000000 &>/dev/null &
Waiting for geth...
Waiting for localhost:8545.
Connected!
$ node ./scripts/gen_accounts.js
$ lerna run test:integration:stress --stream
lerna notice cli v6.6.2
lerna info versioning independent

> web3:"test:integration:stress"

web3: $ jest --config=./test/stress/jest.config.js --forceExit
web3:  PASS  test/stress/validation.test.ts
web3:  PASS  test/stress/data.test.ts (7.124 s)
web3:  PASS  test/stress/requests.test.ts (9.352 s)
web3: Test Suites: 3 passed, 3 total
web3: Tests:       9 passed, 9 total
web3: Snapshots:   0 total
web3: Time:        9.617 s
web3: Ran all test suites.
web3: Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  Lerna (powered by Nx)   Successfully ran target test:integration:stress for project web3


$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh stop
Stopping geth ...
$ ./scripts/test-runner.sh geth-manual ipc node manual
Node software used for tests:  geth-manual
Node running on:  ipc://127.0.0.1:8545
$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh manualStart 1
Starting manual geth...
geth --ipcpath /Users/alexeykosinski/work/chainsafe/web3.js/tmp/ipc.ipc --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 8545 --http --http.addr 0.0.0.0 --http.port 8545 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev --mine --dev.period=0 --dev.gaslimit 9000000000000000 --rpc.txfeecap=1000000 &>/dev/null &
Waiting for geth...
Waiting for localhost:8545.
Connected!
$ node ./scripts/gen_accounts.js
$ lerna run test:integration:stress --stream
lerna notice cli v6.6.2
lerna info versioning independent

> web3:"test:integration:stress"

$ jest --config=./test/stress/jest.config.js --forceExit
web3:  PASS  test/stress/validation.test.ts (5.449 s)
web3:  PASS  test/stress/requests.test.ts (5.424 s)
web3:  PASS  test/stress/data.test.ts (8.809 s)
web3: Test Suites: 3 passed, 3 total
web3: Tests:       9 passed, 9 total
web3: Snapshots:   0 total
web3: Time:        9.291 s, estimated 10 s
web3: Ran all test suites.
web3: Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  Lerna (powered by Nx)   Successfully ran target test:integration:stress for project web3


$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh stop
Stopping geth ...
$ ./scripts/test-runner.sh geth-manual ws chrome manual
Node software used for tests:  geth-manual
Node running on:  ws://127.0.0.1:8545
$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh manualStart 1
Starting manual geth...
geth --ipcpath /Users/alexeykosinski/work/chainsafe/web3.js/tmp/ipc.ipc --nodiscover --nousb --ws --ws.addr 0.0.0.0 --ws.port 8545 --http --http.addr 0.0.0.0 --http.port 8545 --allow-insecure-unlock --http.api personal,web3,eth,admin,debug,txpool,net --ws.api personal,web3,eth,admin,debug,miner,txpool,net --dev --mine --dev.period=0 --dev.gaslimit 9000000000000000 --rpc.txfeecap=1000000 &>/dev/null &
Waiting for geth...
Waiting for localhost:8545.
Connected!
$ node ./scripts/gen_accounts.js
$ /Users/alexeykosinski/work/chainsafe/web3.js/node_modules/.bin/lerna run test:e2e:chrome:stress --stream
lerna notice cli v6.6.2
lerna info versioning independent

> web3:"test:e2e:chrome:stress"

web3: $ npx cypress run --headless --browser chrome
web3: 2023-11-27 18:07:28.369 Cypress[64554:4452251] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
web3: Couldn't find tsconfig.json. tsconfig-paths will be skipped
web3: ====================================================================================================
web3:   (Run Starting)
web3:   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
web3:   │ Cypress:        10.7.0                                                                         │
web3:   │ Browser:        Chrome 119 (headless)                                                          │
web3:   │ Node Version:   v16.18.0 (/usr/local/bin/node)                                                 │
web3:   │ Specs:          3 found (data.test.ts, requests.test.ts, validation.test.ts)                   │
web3:   │ Searched:       test/e2e_manual/**/**/*.test.ts                                                │
web3:   └────────────────────────────────────────────────────────────────────────────────────────────────┘
web3: ────────────────────────────────────────────────────────────────────────────────────────────────────
web3:                                                                                                     
web3:   Running:  data.test.ts                                                                    (1 of 3)
web3: 
web3:   huge data
web3:     ✓ send and get (3306ms)
web3:   1 passing (3s)
web3:   (Results)
web3:   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
web3:   │ Tests:        1                                                                                │
web3:   │ Passing:      1                                                                                │
web3:   │ Failing:      0                                                                                │
web3:   │ Pending:      0                                                                                │
web3:   │ Skipped:      0                                                                                │
web3:   │ Screenshots:  0                                                                                │
web3:   │ Video:        false                                                                            │
web3:   │ Duration:     3 seconds                                                                        │
web3:   │ Spec Ran:     data.test.ts                                                                     │
web3:   └────────────────────────────────────────────────────────────────────────────────────────────────┘
web3: ────────────────────────────────────────────────────────────────────────────────────────────────────
web3:                                                                                                     
web3:   Running:  requests.test.ts                                                                (2 of 3)
web3: 
web3:   huge data
web3:     ✓ send requests (4326ms)
web3:     ✓ get requests (32ms)
web3:   2 passing (4s)
web3:   (Results)
web3:   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
web3:   │ Tests:        2                                                                                │
web3:   │ Passing:      2                                                                                │
web3:   │ Failing:      0                                                                                │
web3:   │ Pending:      0                                                                                │
web3:   │ Skipped:      0                                                                                │
web3:   │ Screenshots:  0                                                                                │
web3:   │ Video:        false                                                                            │
web3:   │ Duration:     4 seconds                                                                        │
web3:   │ Spec Ran:     requests.test.ts                                                                 │
web3:   └────────────────────────────────────────────────────────────────────────────────────────────────┘
web3: ────────────────────────────────────────────────────────────────────────────────────────────────────
web3:                                                                                                     
web3:   Running:  validation.test.ts                                                              (3 of 3)
web3: 
web3:   validator
web3:     ✓ huge schema (61ms)
web3:     ✓ huge schema 1000 (78ms)
web3:     ✓ simple schema multiple times (32ms)
web3:     ✓ simple schema 1000 times (60ms)
web3:     ✓ simple JSON schema 1000 times (45ms)
web3:     ✓ simple ABI 1000 times (42ms)
web3:   6 passing (332ms)
web3:   (Results)
web3:   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
web3:   │ Tests:        6                                                                                │
web3:   │ Passing:      6                                                                                │
web3:   │ Failing:      0                                                                                │
web3:   │ Pending:      0                                                                                │
web3:   │ Skipped:      0                                                                                │
web3:   │ Screenshots:  0                                                                                │
web3:   │ Video:        false                                                                            │
web3:   │ Duration:     0 seconds                                                                        │
web3:   │ Spec Ran:     validation.test.ts                                                               │
web3:   └────────────────────────────────────────────────────────────────────────────────────────────────┘
web3: ====================================================================================================
web3:   (Run Finished)
web3:        Spec                                              Tests  Passing  Failing  Pending  Skipped  
web3:   ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
web3:   │ ✔  data.test.ts                             00:03        1        1        -        -        - │
web3:   ├────────────────────────────────────────────────────────────────────────────────────────────────┤
web3:   │ ✔  requests.test.ts                         00:04        2        2        -        -        - │
web3:   ├────────────────────────────────────────────────────────────────────────────────────────────────┤
web3:   │ ✔  validation.test.ts                       329ms        6        6        -        -        - │
web3:   └────────────────────────────────────────────────────────────────────────────────────────────────┘
web3:     ✔  All specs passed!                        00:08        9        9        -        -        -  

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  Lerna (powered by Nx)   Successfully ran target test:e2e:chrome:stress for project web3


$ WEB3_SYSTEM_TEST_BACKEND=geth && ./scripts/geth_binary.sh stop
Stopping geth ...
✨  Done in 82.75s.
alexeykosinski@mac web3.js % 

@avkos avkos merged commit e6d8c14 into 4.x Nov 28, 2023
64 of 65 checks passed
@avkos avkos deleted the ok/5562-Stress-Tests-1---QA-Tests branch November 28, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stress Tests 1 - QA Tests
4 participants