-
Notifications
You must be signed in to change notification settings - Fork 61
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
chore: Implement memory leak detection in tests #2695
chore: Implement memory leak detection in tests #2695
Conversation
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
…ction-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # package-lock.json # package.json # packages/server/tsconfig.json
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # package-lock.json # package.json # packages/server/tsconfig.json
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Once this is merged it will get picked up in CI. I'd like to discuss briefly some window of time during the first release when this is run, and you can be available if the CI breaks down. CI updates can make releases interesting.
Signed-off-by: Eric Badiere <ebadiere@gmail.com>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful work 🚀 🚀 !! Some qqs
* chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add docs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: fix sonar issues Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: small fix Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: trace GC and write snapshot if memory leak > 0.5 MB Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert false changes to eth.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: optimize code Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # package-lock.json # package.json # packages/server/tsconfig.json * fix: Do not write heap snapshots for acceptance tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add TODO for removing --trace_gc flag Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add github comment in cases a test is having memory leaks Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add github context env variables Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: extract common logic for github api calls Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: console.debug -> console.log for successful PR comments Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: fix request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts * fix: request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add upload heap snapshots step in github workflow for acceptance and integration tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add `subject_type: file` to github request for adding comment on PR Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: fix path in request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: extract github request logic in new file - githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: path of upload-artifact action for uploading heap snapshots Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: requests in githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: requests in githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: format message of github-actions[bot] Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: format message of github-actions[bot] Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove unused github context env variable Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `formatBytes` returns `NaN undefined` when `0` is passed to it Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `formatBytes` returns `NaN undefined` when negative number is passed to it Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: predicate for updating existing comment Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: remove unused constant + temporary console logs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: make memory leak report more descriptive Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove unnecessary console logs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: reduce MEMORY_LEAK_SNAPSHOT_THRESHOLD to 500 KB Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: update logic for detecting memory leak based on heap size threshold Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add separate threshold for taking heap snapshots Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: set `WRITE_SNAPSHOT_ON_MEMORY_LEAK` to be `false` by default Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add warm-up phase to memory leak detection Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert changes to rpc_batch1.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: Eric Badiere <ebadiere@gmail.com> Co-authored-by: Eric Badiere <ebadiere@gmail.com> Signed-off-by: ebadiere <ebadiere@gmail.com>
* chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add docs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: fix sonar issues Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: small fix Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: trace GC and write snapshot if memory leak > 0.5 MB Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert false changes to eth.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: optimize code Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # package-lock.json # package.json # packages/server/tsconfig.json * fix: Do not write heap snapshots for acceptance tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add TODO for removing --trace_gc flag Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add github comment in cases a test is having memory leaks Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add github context env variables Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: extract common logic for github api calls Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: console.debug -> console.log for successful PR comments Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: fix request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts * fix: request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add upload heap snapshots step in github workflow for acceptance and integration tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add `subject_type: file` to github request for adding comment on PR Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: fix path in request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: extract github request logic in new file - githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: path of upload-artifact action for uploading heap snapshots Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: requests in githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: requests in githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: format message of github-actions[bot] Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: format message of github-actions[bot] Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove unused github context env variable Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `formatBytes` returns `NaN undefined` when `0` is passed to it Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `formatBytes` returns `NaN undefined` when negative number is passed to it Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: predicate for updating existing comment Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: remove unused constant + temporary console logs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: make memory leak report more descriptive Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove unnecessary console logs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: reduce MEMORY_LEAK_SNAPSHOT_THRESHOLD to 500 KB Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: update logic for detecting memory leak based on heap size threshold Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add separate threshold for taking heap snapshots Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: set `WRITE_SNAPSHOT_ON_MEMORY_LEAK` to be `false` by default Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add warm-up phase to memory leak detection Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert changes to rpc_batch1.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: Eric Badiere <ebadiere@gmail.com> Co-authored-by: Eric Badiere <ebadiere@gmail.com> Signed-off-by: ebadiere <ebadiere@gmail.com>
* test: added E2E test for preemtive rate limit (#2753) * test: added E2E test fir preemtive rate limit Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * Update hbarLimiter.spec.ts Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> --------- Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> Signed-off-by: ebadiere <ebadiere@gmail.com> * test: expand integration tests for SDK client (#2756) * test: expand integration tests for SDK client Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: minor improvements to sdkClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: typescript error Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: simplify test data Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: fix typescript errors and warnings Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: optimize imports Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: address comments Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: improve readability of tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: fix wrong MIRROR_NODE_LIMIT_PARAM in relay tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: wrong env file loaded Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: remove hardcoded usages of MIRROR_NODE_LIMIT_PARAM in relay tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: revert changes to rpc_batch1.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove unused import Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: fix test after merge Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: fix test after merge Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert changes to usages of MIRROR_NODE_LIMIT_PARAM Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert changes to usages of MIRROR_NODE_LIMIT_PARAM Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: ebadiere <ebadiere@gmail.com> * feat: search contract logs only by transaction hash (#2762) * chore: refactor eth.ts Signed-off-by: nikolay <n.atanasow94@gmail.com> * chore: bump hedera-local version Signed-off-by: nikolay <n.atanasow94@gmail.com> --------- Signed-off-by: nikolay <n.atanasow94@gmail.com> Signed-off-by: ebadiere <ebadiere@gmail.com> * chore: Implement memory leak detection in tests (#2695) * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: Implement memory leak detection in tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add docs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: fix sonar issues Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: small fix Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: trace GC and write snapshot if memory leak > 0.5 MB Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert false changes to eth.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: optimize code Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # package-lock.json # package.json # packages/server/tsconfig.json * fix: Do not write heap snapshots for acceptance tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add TODO for removing --trace_gc flag Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add github comment in cases a test is having memory leaks Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add github context env variables Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: extract common logic for github api calls Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: console.debug -> console.log for successful PR comments Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: fix request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts * Merge branch 'main' into 2260-Implement-a-Memory-Leak-detection-Test Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> # Conflicts: # packages/server/tests/acceptance/index.spec.ts * fix: request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: add upload heap snapshots step in github workflow for acceptance and integration tests Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add `subject_type: file` to github request for adding comment on PR Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: fix path in request to github API Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: extract github request logic in new file - githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: path of upload-artifact action for uploading heap snapshots Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: requests in githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: requests in githubClient.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: format message of github-actions[bot] Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: format message of github-actions[bot] Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove unused github context env variable Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: formatting Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `formatBytes` returns `NaN undefined` when `0` is passed to it Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `formatBytes` returns `NaN undefined` when negative number is passed to it Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: predicate for updating existing comment Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: remove unused constant + temporary console logs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: make memory leak report more descriptive Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: remove unnecessary console logs Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: reduce MEMORY_LEAK_SNAPSHOT_THRESHOLD to 500 KB Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: update logic for detecting memory leak based on heap size threshold Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: add separate threshold for taking heap snapshots Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: set `WRITE_SNAPSHOT_ON_MEMORY_LEAK` to be `false` by default Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: add warm-up phase to memory leak detection Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * chore: revert changes to rpc_batch1.spec.ts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: Eric Badiere <ebadiere@gmail.com> Co-authored-by: Eric Badiere <ebadiere@gmail.com> Signed-off-by: ebadiere <ebadiere@gmail.com> * feat: deprecate `ETH_POPULATE_SYNTHETIC_CONTRACT_RESULTS` env (#2768) * chore: remove env Signed-off-by: nikolay <n.atanasow94@gmail.com> * chore: modify test Signed-off-by: nikolay <n.atanasow94@gmail.com> --------- Signed-off-by: nikolay <n.atanasow94@gmail.com> Signed-off-by: ebadiere <ebadiere@gmail.com> * Bump versions for v0.53.0-rc1 Signed-off-by: Swirlds Automation <swirlds-eng-automation@swirlds.com> Signed-off-by: ebadiere <ebadiere@gmail.com> * feat: reused executetransaction for methods in sdkclient and improved… (#2776) feat: reused executetransaction for methods in sdkclient and improved logging (#2749) * fix: reused executeTransaction() in deleteFile() method * fix: reworked executeTransaction() to accept executeAll * feat: fix: reused executeTransaction() in fileCreate() method * fix: removed check rate limit in executeGetTransactionRecord * fix: fixed SDK HBAR limiter tests * fix: reverted rework executeTransaction() * fix: reworked formatRequestIdMessage * feat: added executeAllTransaction() method * fix: made shouldLimit optional in executeTransaction() * Update packages/relay/src/lib/clients/sdkClient.ts * fix: addressed comments * fix: extracted handleExecuteAllError() * fix: renamed handleExecuteAllError to getTransactionMetrics and reuse it in executeTransaction --------- Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> Signed-off-by: Logan Nguyen <logan@quiet-node.dev> Co-authored-by: Logan Nguyen <logan.nguyen@swirldslabs.com> Co-authored-by: Victor Yanev <161485803+victor-yanev@users.noreply.github.com> Signed-off-by: ebadiere <ebadiere@gmail.com> * Bump versions for v0.53.0-rc2 Signed-off-by: Swirlds Automation <swirlds-eng-automation@swirlds.com> Signed-off-by: ebadiere <ebadiere@gmail.com> * fix: reduce hbar limit only by operator fees (#2755) * fix: reduce hbar limit only by operator fees Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * chore: update expected values Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * chore: fix code smells Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * nit: re-trigger ci Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * chore: addressing comments Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: hbar limit error handle Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: reduce test flakiness Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: reduce test flakiness Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * nit: update comment Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: unit test mocks Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: update assertions and mocks Signed-off-by: Ivo Yankov <ivo@devlabs.bg> --------- Signed-off-by: Ivo Yankov <ivo@devlabs.bg> Signed-off-by: Eric Badiere <ebadiere@gmail.com> Co-authored-by: Eric Badiere <ebadiere@gmail.com> Signed-off-by: ebadiere <ebadiere@gmail.com> --------- Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> Signed-off-by: ebadiere <ebadiere@gmail.com> Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: nikolay <n.atanasow94@gmail.com> Signed-off-by: Eric Badiere <ebadiere@gmail.com> Signed-off-by: Swirlds Automation <swirlds-eng-automation@swirlds.com> Signed-off-by: Logan Nguyen <logan@quiet-node.dev> Signed-off-by: Ivo Yankov <ivo@devlabs.bg> Co-authored-by: Logan Nguyen <logan.nguyen@swirldslabs.com> Co-authored-by: Victor Yanev <161485803+victor-yanev@users.noreply.github.com> Co-authored-by: Nikolay Atanasow <n.atanasow94@gmail.com> Co-authored-by: Swirlds Automation <swirlds-eng-automation@swirlds.com> Co-authored-by: Ivo Yankov <ivo@devlabs.bg>
Description:
This PR introduces a method
captureMemoryLeaks
to detect and report potential memory leaks in test suites, enhancing the reliability and performance of applications by ensuring early detection and resolution of memory leaks.It leverages the
V8
engine's garbage collection (GC) profiling capabilities to monitor memory usage before and after test execution, identifying significant increases intotalHeapSize
that may indicate a memory leak.setFlagsFromString('--expose_gc')
command. This allows for manual triggering of garbage collection within the test environment.profiler.start()
is called to set up the GC profiler to monitor heap usage and other GC-related statistics during the test execution.await gc()
to ensure that all unreferenced objects are cleared from memory. This step aims to capture the most accurate state of the heap after test execution.profiler.stop()
, and the method collects the GC statistics, including heap sizes before and after the GC.500KB
(defined asHEAP_SIZE_DIFF_MEMORY_LEAK_THRESHOLD
), it indicates a potential memory leak.WRITE_SNAPSHOT_ON_MEMORY_LEAK
), a heap snapshot is taken for leaks exceeding1MB
(defined asHEAP_SIZE_DIFF_SNAPSHOT_THRESHOLD
). This snapshot can be used for a more in-depth analysis of the memory allocation and retention patterns. (this env is disabled everywhere by default and can be enabled locally by the person who is investigating the memory leak)Related issue(s):
Fixes #2260
Notes for reviewer:
Checklist