Closed klewis-sfdc closed 1 year ago
Affects me
I am executing a SFDX CLI command to run apex tests
sfdx force:apex:test:run -l RunLocalTests --loglevel=trace -y -c -r json -d ./tests/apex -w 20
but it fails with a Timeout error. Even when I tried to increase the -wait parameter like this
sfdx force:apex:test:run -l RunLocalTests --loglevel=trace -y -c -r json -d ./tests/apex -w 999999
it still fails with the same error:
echo $(sfdx force:apex:test:run -l RunLocalTests --loglevel=trace -y -c -r json -d ./tests/apex -w 999999) > tests.json WARNING: WARNING: In the Summer ’21 release, we'll rename or remove some of the output files that are created when you run force:apex:test:run or force:apex:test:report with the --outputdir (-d) parameter. This breaking change could impact your CI/CD scripts if they reference specific filenames. See https://sfdc.co/apex-test-updates for details
CLIError: timed out at Object.error (/usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/errors/index.js:28:15) at /usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/cli-ux/index.js:25:66 at async flush (/usr/local/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/cli-ux/index.js:124:9) { oclif: { exit: 2 }, code: undefined } ERROR running force:apex:test:run: Unknown error in Apex Library: timed out
This affects me as well. It just started happening in our CI.
CLIError: timed out
at Object.error (/opt/hostedtoolcache/node/18.13.0/x64/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/errors/index.js:28:15)
at /opt/hostedtoolcache/node/18.13.0/x64/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/cli-ux/index.js:25:66
at async flush (/opt/hostedtoolcache/node/18.13.0/x64/lib/node_modules/sfdx-cli/node_modules/@oclif/core/lib/cli-ux/index.js:124:9) {
oclif: { exit: 2 },
code: undefined
}
trying to replace npm install -g sfdx-cli
by npm install -g sfdx-cli@7.184.0
in the CI script file to downgrade the SFDX CLI version and avoid the error
@bdovh Yeah that is what I am having to do until this is resolved. Thanks for suggestion though!
Closing this as fixed via an update to the sfdx cli. The update should be included in the cli latest release candidate, which is 7.186.2.
Summary
Users have reported seeing a
CLIError: timed out
error when runningsfdx force:apex:test:run --resultformat junit --testlevel RunSpecifiedTests --wait=-1
for test suites that were running fine in previous versions starting in cli release 7.185.The error message also states:
ERROR running force:apex:test:run: Unknown error in Apex Library: timed out
.7.185 is the first CLI version to be released with apex-node library 1.6 (via plugin-source 2.3.15).
Steps To Reproduce:
TBD
Expected result
A test suite that runs successfully under CLI version 7.184 should also run successfully under CLI version 7.185.
Actual result
The test suite fails under version 7.185, and the output is not formatted as valid XML.
Additional information
Apex library Version: 1.6
OS and version: