-
Notifications
You must be signed in to change notification settings - Fork 412
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
"Run Test" action hanging #6131
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. |
Hello @joshua-nicholson 👋 It looks like you didn't provide all the required basic info in your issue. If you haven't already, please provide the following info: Here's an example of a set of required info that will pass the validation: A few more things to check:
Thank you! |
There were no error messages produced in any of the output panels and I am not sure what version I was on when this was working previously. |
Hello @joshua-nicholson, can you confirm Apex extension is activated? You can verify it if you run |
Hi @CristiCanizales thanks for the quick response. I verified the Apex extension is running. My JAVA_HOME env var was somehow unset, I corrected this but I'm still seeing the same behavior. Here is the JDK I'm using: openjdk version "21.0.3" 2024-04-16 LTS Both the Apex and Apex Language Server aren't giving me any relevant errors that I can see. Apex simply outputs:
The Apex Language Server shows the extensions starting up.
|
Thanks for providing the details. Just to make sure, are you successfully connected to the org you want to run the tests from? If so, is it your default org? And your local project is up to date with your org? |
Yes I was able to successfully authorize my org and set it as the default. Could you explain what you mean by my local project being up to date with the org specifically? I believe it should be, our Apex code is tracked in version control and I have the latest changes, additionally the org I'm connecting to is a developer org I just created from production. |
I mean if the apex class you want to use to run the test + the test are deployed |
Yes both of these have been deployed. |
This is giving me the same issue. |
Would you mind creating those two apex classes in your project, deploying to the org and running the test from the 2nd one to check if it works with that? |
I'm still seeing the same behavior with this test class. |
@joshua-nicholson Would you mind running the tests again for me with debug enabled? In workspace settings search for SF_LOG_LEVEL and change the setting to debug In folder Could you also provide the org Id on which you are using to run tests. |
@joshua-nicholson thanks for the log. I can see that the test run is trying to establish a connection to your org, but I do not see a return from that request. So I have a comparison logs, run the tests using sf bug but using the doctor command Is the target org a scratch org? |
The target org is a developer org created from my production org. I think this command turned up the source of my issue.
What's strange is I can run commands directly for testing, for example.
This runs with no issues, it's just the way the extensions provides to run tests that isn't working. Is there some way I can manually download the manifest? Proxies seem to be working otherwise. |
@joshua-nicholson sorry if I raised your blood pressure with my earlier message challenging the version you are using. Some suggestions to try: Since the command works in the terminal but fails within VSCode, the issue likely involves how VSCode handles network configurations, environment variables, or how the extension spawns the process. Here are some things to check:
Open VSCode settings (Cmd+Shift+P → "Preferences: Open Settings (UI)").
Run Developer: Open Environment Variables in the command palette to compare with your terminal's environment.
If it works there, the issue might be related to how VSCode extensions spawn subprocesses. Run sf env list to check if the expected authentication and environment are detected.
Close VSCode and restart it using the terminal with code . to ensure it inherits the correct environment variables.
If you're using a corporate network, ensure that VSCode is not blocked from accessing external resources. |
No worries, I thought you saw something in the logs that indicated I was using an earlier version than I listed so I thought that might be an avenue to investigate at first. I'll give this a try, thanks. |
Summary
If I click "Run Test" on any of my tests, I get a dialogue box that says "Running SFDX: Running Apex tests". This continues indefinitely and the test is never executed. I checked Salesforce and it does not show a test run was ever attempted. If I manually execute the test via the CLI it works fine.
Steps To Reproduce:
Expected result
Test should execute in a timely manner.
Actual result
Test execution is never attempted
Additional information
Salesforce Extension Version in VS Code: 63.2.3
Salesforce CLI Version: @salesforce/cli/2.78.3 darwin-arm64 node-v22.13.0
OS and version: macOS Sonoma 14.7.3 (23H417)
VS Code version: 1.98.0
Most recent version of the extensions where this was working: Unknown
The text was updated successfully, but these errors were encountered: