forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
953 stars 405 forks source link

sf apex get tests hangs for two minutes #5381

Open cinicola opened 10 months ago

cinicola commented 10 months ago

Summary

Steps To Reproduce

Get a org with a big number of tests, and run the command:

sf apex get test --test-run-id=707XXXXXXXXX --target-org YourOrgAlias

Expected result

The CLI executes the command, displaying the test results in a few seconds and releases the prompt.

Actual result

The CLI executes the command, displaying the test results in a few seconds, but is keeping the command running for about 2 minutes. After these 2 minutes, the prompt is released.

This behavior is holding up Github Actions running and using limits unnecessarily.

The same problem is ocurring when you ask to run tests:

sf apex test run -l RunLocalTests --target-org YourOrgAlias

The test execution request happens in a few seconds, but the terminal is locked for two minutes.

System Information

I tried to run this commands in PowerShell with the last cli version and in Linux bash *Github Actions( and the behavior is the same.

CLI Version: @salesforce/cli/2.25.7 win32-x64 node-v20.10.0

github-actions[bot] commented 10 months ago

Hello @cinicola :wave: It looks like you didn't include the full Salesforce CLI version information in your issue. Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

Thank you!

github-actions[bot] commented 10 months ago

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.

mshanemc commented 10 months ago

How many tests do we need to replicate the problem?

cinicola commented 10 months ago

Hello @mshanemc. The org with the symptom has with 2.700 tests. Other orgs with hundreds of tests I don't have problem.

cinicola commented 10 months ago

I just uploaded a video showing the issue:

https://www.youtube.com/watch?v=FruBOh_G10w

mshanemc commented 10 months ago

I transferred this to the VSCode team, who owns the TestService that the apex plugin is calling. I'm wildly speculating that this is related to its use of the StreamingAPI.

https://github.com/forcedotcom/salesforcedx-vscode/issues/5381

peternhale commented 10 months ago

Thanks @mshanemc @cinicola I am going to move this over to out primary issues repo.

luizMoraisBuilders commented 10 months ago

Hi, I have the same issue. Is there any update on this?

BrunaToledoC commented 9 months ago

Hello everyone! We're having the same time loss here, I'd appreciate receiving updates in this issue please.

tggagne commented 3 weeks ago

I'm noticing this issue in...

@salesforce/cli/2.64.8 linux-x64 node-v18.20.4