-
Notifications
You must be signed in to change notification settings - Fork 406
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
"sfdx force:apex:test:run" and "sfdx force:apex:test:report" --wait and --codecoverage options not functioning as expected. #3172
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. |
Hi @conundrum1 thanks for reporting this! We'll work on reproducing this behavior so we can see what might be going on. In previous versions of the cli, how long did the test typically run for? |
Hi @AnanyaJha , thanks for checking into what might be going on with this issue. In previous versions of the cli, typically our tests would run for about 4 - 5 hours. |
This issue has been linked to a new work item: W-9179311 |
Hi @conundrum1 it looks like there's a few different things that could be happening here, it's possible the Streaming API is losing connection which is why the tests are timing out early. We'll work on debugging what might be happening in this scenario and will update this thread with a fix once we have it, thanks! |
also happens to us. when is it going to be resolved? |
We got the same 403 errors today in our Ci flow |
Also getting this consistently now. It was more sporadic before, but it happens every day on multiple CI build nodes now. |
Hi all, thanks for reaching out. Can you please post what versions of the Apex plugin your CLI is currently using? This can be found by running |
Our nodes were using |
@AnanyaJha I'm seeing a different error now.
This error is received after about 2 hours into the job running. |
Thanks @mrichmon12 ! This matches what we see locally as well - is it possible for you to access the test run in Developer Console? And see if the tests are still running in the org? |
@AnanyaJha For what it's worth, updating the apex plugin from 0.2.2 to 0.2.3 worked for me.
I've had 2 successful runs of a nightly scheduled job on my Jenkins server that runs all tests on a sandbox. It takes just under 6 hours to run all tests using following command:
Prior to updating the apex plugin the job had been failing every night for well over a month with the the following error:
|
@AnanyaJha it's not running now, but I'm not certain that the run wasn't still executing when we received the error. |
@AnanyaJha I ran another one to observe this more closely. The 414 error is returned when the test run completes. |
@mrichmon12 To confirm, with the new version |
@AnanyaJha I looked back through the build history for the last month that was on We haven't seen the 403 error since upgrading to |
@AnanyaJha we started to have the same issue as described |
@AnanyaJha a couple of other failure variations to report. Not sure if they are related or not, but the end result is the same, no unit test results or code coverage results.
We have seen this error before and have set the SFDX_MAX_QUERY_LIMIT variable in increasing increments (25k, 28k, 35k, 40k) over the past month. I'm not sure what is being queried here that is returning so many results and why it keeps increasing.
Seems like there was an unhandled network exception, but the command kept running and eventually returned the |
Hi @mrichmon12 thanks for sharing the data. We've been able to reproduce the issue locally as well and have logged a bug to address it. We'll be sure to update the thread with more info once we have it! |
@mrichmon12 just following up on this since we were able to get that work in on our side; are you still seeing the issue, or are we good to close this? |
This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance. |
I have the following error. Is this the same error or a new one? echo $(sfdx force:apex:test:run -l RunLocalTests --loglevel=trace -y -c -r json -d ./tests/apex -w 999999) > tests.json CLIError: timed out |
Hi team, I am also getting the following errors: CLIError: timed out |
Hi Team, ERROR running force:apex:test:run: Unknown error in Apex Library: 403::Unknown client Is there any fix for this issue. |
Hi @gourdeepti - can you please open a new issue with the details of what you're facing? Thanks! |
Summary
Summary:
When running, "sfdx force:apex:test:run", it ends after 180 minutes, even though -w option is set to longer wait time (i.e. 1440 minutes). Also, test results and coverage report are not returned, even when running the "sfdx force:apex:test:report" command, afterward.
Steps To Reproduce:
Repository to reproduce: dreamhouse-lwc
NOTE: If your issue is not reproducable by dreamhouse-lwc, i.e. requires specific metadata or files, we require a link to a simple Salesforce project repository with a script to setup a scratch org that reproduces your problem.
Expected result
In the previous version of the sfdx cli (7.94.3), we received the following expected results:
For the "sfdx force:apex:test:run -r human -c -l RunLocalTests -w 1440 --verbose" command, we expect to see the following messages while tests are running:
Listning for results
Invoking Apex tests using UID...
Started async test run job: 7072C00001gPNb1QAG
Processing event for job 7072C00001gPNb1QAG
Processing event for job 7072C00001gPNb1QAG
Processing event for job 7072C00001gPNb1QAG
...
Once test run completes, expect to see the test results and the code coverage report in human readable format.
Retrieving test results for job 7072C00001gPNb1QAG...
=== Apex Code Coverage
...
Actual result
sfdx force:apex:test:run -r human -c -l RunLocalTests -w 1440 --verbose
Even though we have wait time set to 1440 minutes, the test run times out and the job ends after 180 minutes.
When it ends after 180 minute, it gives following error:
Error: 403::Unknown client
at Object.incoming (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/lib/src/streaming/streamingClient.js:62:27)
at pipe (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:932:43)
at klass.pipeThroughExtensions (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:934:5)
at klass._receiveMessage (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:1413:10)
at klass.handler (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:795:41)
at klass.EventEmitter.emit (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:236:17)
at klass.handleResponse (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:1580:10)
at klass._receive (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:1740:24)
at IncomingMessage. (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:2724:14)
at IncomingMessage.emit (node:events:381:22)
Error: 403::Unknown client
at Object.incoming (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/lib/src/streaming/streamingClient.js:62:27)
at pipe (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:932:43)
at klass.pipeThroughExtensions (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:934:5)
at klass._receiveMessage (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:1413:10)
at klass.handler (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:795:41)
at klass.EventEmitter.emit (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:236:17)
at klass.handleResponse (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:1580:10)
at klass._receive (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:1740:24)
at IncomingMessage. (/home/svc_devopsci/.local/share/sfdx/client/7.97.0-c130e7a/node_modules/@salesforce/apex-node/node_modules/faye/node/faye-node.js:2724:14)
at IncomingMessage.emit (node:events:381:22)
ERROR running force:apex:test:run: Unknown error in Apex Library: 403::Unknown client
However, the test run continues running in the Salesforce org. While it is running, if we attempt the following command to retrieve a report with the test run job id:
sfdx force:apex:test:report -i 7072C00001gPNb1QAG -c -r human
We received the following error:
ERROR running force:apex:test:report: Cannot read property 'records' of null
Once the test run completes in the org, when we attempt the same command again:
sfdx force:apex:test:report -i 7072C00001gPNb1QAG -c -r human
It returns the following error:
ERROR running force:apex:test:report:
Bad Message 431
Additional information
SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.97.0 linux-x64 node-v15.14.0
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.2 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.10.0 (core)
@oclif/plugin-update 1.4.0-3 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.9 (core)
auth 1.5.1 (core)
config 1.2.8 (core)
generator 1.1.5 (core)
salesforcedx 51.8.0 (core)
├─ data 0.4.3 (core)
├─ apex 0.1.21 (core)
├─ custom-metadata 1.0.12 (core)
├─ limits 1.0.5 (core)
├─ org 1.6.2 (core)
├─ schema 1.0.5 (core)
├─ templates 51.3.0 (core)
├─ user 1.2.8 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
└─ salesforce-alm 51.6.11 (core)
sfdx-cli 7.97.0 (core)
telemetry 1.1.2 (core)
OS and version:
linux-x64
The text was updated successfully, but these errors were encountered: