-
Notifications
You must be signed in to change notification settings - Fork 405
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
sf apex get test
throws heap out of memory
#5589
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
Here are last few lines of a log. It might be helpful to determine failing operation
|
Could you try installing plugin-apex 3.1.3 (the version used by [email protected]) and see if that resolves the issue? I'm asking because that was the last version before we updated the underlying apex-node library to a new major version. If 3.1.3 works for you then we know that this issue is likely coming from that new major version Thanks! |
yes, it resolves the issue. One more observation. I was casually looking at memory consumption of node process while running the command with apex 3.1.3. It seems it is doing some querying of an org for half an hour (code coverage?). During this time memory consumption steadily rose to 400MB. Then rapidly consume 1.7GB and then quit. As I wrote it doesn’t fail, but the memory consumption still seems much too high. On apex 3.1.11 the memory consumption exceeds 4GB and it fails. The numbers above are for our project. You are welcome to use scratch orgs provided for debugging the issue. |
This issue has been linked to a new work item: W-15724695 |
@pawel-id Maybe you want to switch to use only Aggregated Code Coverage. |
Issue has been fixed and the code change is released in v61.1.2 of the Salesforce Extensions for VSCode ✅ |
Summary
We have quite big project having currently c.a. 2300+ apex tests. Starting with version @salesforce/cli/2.37.4 we are experiencing heap out memory when triggering those tests via CLI. The tests on the org runs fine, however on the CLI we have:
It seems that CLI tries to allocate more then 4GB memory and fails.
Affected commands:
sf apex run test -c -v -r junit -w 480 -l RunLocalTests -d output
- this is complete command we initially found that problem. It runs the tests for many hours and then do some post-processing and finally fail.sf apex get test -c -i 707afas... -d output
- this is a bit simpler command retrieving existing test run and doing only the post processing. It fails the same way, but it doesn’t require to run tests, but rather gather existing tests and doing some post processing. This is minimal and convenient way to replicate.Steps to reproduce
707...
sf apex get test -c -i 7073O00002aQRQqQAO -c -d output
. This usually takes 15-20 min and then it fails with heap out of memory.NODE_OPTIONS=--max-old-space-size=4096
(just guessing).Expected result
Test report saved into
output
folder.Actual result
The CLI exists with non zero exit code and heap out of memory as above.
System Information
We replicated this on macOS, Linux and Windows. It seems not OS dependent.
The text was updated successfully, but these errors were encountered: