-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(verifier-client): add stress test and fix a memory leak
- Add a new package `@hyperledger/cactus-test-verifier-client` for verifier-client stress and functional tests that involve multiple packages. - Add stress test for verifier-client that reports memory usage of repeated operation on `cactus-plugin-ledger-connector-go-ethereum-socketio` connector plugin. - Fix a memory leak in `SocketIOApiClient` - free socket listeners when they are no longer needed. - Fix `cactus-plugin-ledger-connector-go-ethereum-socketio` - use single a web3 connection (with keep-alive/reconnect) instead of spawning new one for each request. Previous solution was causing connection issues in stress testing. Depends on: #2089 Closes: #2189 Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
- Loading branch information
Showing
11 changed files
with
517 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# `@hyperledger/cactus-test-verifier-client` | ||
|
||
## Usage | ||
|
||
### Stress test | ||
- Used for manual leak analysis. | ||
- The test will execute with exposed GC and disabled optimizations. | ||
- Results will be written to `./integration-with-verifier-client-stress.log` for further analysis (in the `cwd` where you execute the command). Columns (in order): | ||
- `rss` | ||
- `heapTotal` | ||
- `heapUsed` | ||
- `external` | ||
- `arrayBuffers` | ||
- Report lines: | ||
- Initial memory usage (before running the tests). | ||
- Usage after running the stress test. | ||
- Usage after freeing the verifier client. | ||
- You can uncomment the `checkMemory` call in test file for more step-by-step report, but it will make the test run longer. | ||
- To investigate with the node debugger use `stress-test-inspect` script. | ||
|
||
``` bash | ||
# Make sure the build was successful before executing these commands. | ||
|
||
# Execute stress test | ||
yarn run stress-test | ||
|
||
# Execute stress test with debugger inspect break | ||
yarn run stress-test-inspect | ||
``` | ||
|
||
## FAQ | ||
|
||
### **What is a dedicated test package for?** | ||
|
||
This is a dedicated test package meaning that it verifies the integration between two packages that are somehow dependent on each other and therefore these tests cannot be added properly in the child package due to circular dependency issues and it would not be fitting to add it in the parent because the child package's tests should not be held by the parent as a matter of principle. |
Oops, something went wrong.