Skip to content
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

force:apex:test:run does not seem to take the wait parameter into account #270

Open
mcartoixa opened this issue Dec 20, 2021 · 5 comments
Open
Labels
bug Something isn't working

Comments

@mcartoixa
Copy link

mcartoixa commented Dec 20, 2021

Summary

We have an old organization with a lot of integration tests that take a while to execute (say between 40' and 60' on the main org). We have set up a Continuous Integration process based on the Saleforce CLI so that these tests are executed (on a Scratch Org) every time a commit is pushed to our repository. As our tests take a long time we use the wait parameter on the force:apex:test:run command to avoid a timeout (-w120 so that we have some leeway).

Lately (but I sadly cannot pinpoint from when exactly) our tests have been failing consistently:

  • the message for failure is "Your request exceeded the time limit for processing. connection was cancelled here" on ~80% of the failing tests.
  • the execution time of the force:apex:test:run command is exactly 60' every time.

We have tried to set a much larger value to the wait parameter but the tests get cancelled at the same point. We have tried to set the wait parameter to a very short value (1') and the command still seems to execute for a very long time.

Steps To Reproduce:

  1. Set up a Scratch Org with tests.
  2. Execute the tests on the Scratch Org: sfdx force:apex:test:run -w1 -lRunLocalTests

Expected result

  • sfdx force:apex:test:run -w1 -lRunLocalTests should cancel the run after ~1'.
  • sfdx force:apex:test:run -w120 -lRunLocalTests should execute all tests.

Actual result

The tests execute for what seems to be a default amount of time (60') whatever the value of wait.

Additional information

Apex library Version:

{
        "cliVersion": "sfdx-cli/7.131.0",
        "architecture": "linux-x64",
        "nodeVersion": "node-v16.13.1",
        "pluginVersions": [
                "@oclif/plugin-autocomplete 0.3.0 (core)",
                "@oclif/plugin-commands 1.3.0 (core)",
                "@oclif/plugin-help 3.2.10 (core)",
                "@oclif/plugin-not-found 1.2.4 (core)",
                "@oclif/plugin-plugins 1.10.10 (core)",
                "@oclif/plugin-update 1.5.0 (core)",
                "@oclif/plugin-warn-if-update-available 1.7.3 (core)",
                "@oclif/plugin-which 1.0.3 (core)",
                "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
                "alias 1.2.0 (core)",
                "apex 0.5.0 (core)",
                "auth 1.8.0 (core)",
                "config 1.3.2 (core)",
                "custom-metadata 1.0.12 (core)",
                "data 0.6.6 (core)",
                "generator 1.2.1 (core)",
                "info 1.1.4 (core)",
                "limits 1.3.0 (core)",
                "org 1.11.0 (core)",
                "salesforce-alm 53.6.0 (core)",
                "schema 1.1.0 (core)",
                "sfdx-cli 7.131.0 (core)",
                "source 1.6.2 (core)",
                "telemetry 1.4.0 (core)",
                "templates 52.6.0 (core)",
                "trust 1.1.0 (core)",
                "user 1.7.0 (core)"
        ],
        "osVersion": "Linux 5.8.0-1043-azure"
}

OS and version:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
@randi274 randi274 added the bug Something isn't working label Dec 22, 2021
@randi274
Copy link
Contributor

Thanks for logging this! We did some testing of an older version of the CLI, and confirmed that it did respect that parameter. A cursory glance over the new code + some additional testing, and we're seeing the same as you, so we'll get this one into the backlog to address.

@mcartoixa
Copy link
Author

Any update?

@randi274 randi274 added bug Something isn't working and removed bug Something isn't working labels Jul 19, 2022
@randi274
Copy link
Contributor

Hi @mcartoixa thanks for the nudge on this one! We haven't fixed this one just yet, but I'm linking the work here (W-11452324) so we can keep better track of resolving it. We'll continue to keep this issue updated as we're able to fix this!

@alan-morey
Copy link

Any update on this?
I assume this bug is also the root cause for similar issue I reported forcedotcom/cli/issues/2108

@cristiand391
Copy link
Member

follow this issue for more updates:
forcedotcom/cli#2108 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants