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

sf apex run test does not run async tests #2837

Closed
cmanaila60 opened this issue Apr 22, 2024 · 5 comments
Closed

sf apex run test does not run async tests #2837

cmanaila60 opened this issue Apr 22, 2024 · 5 comments
Labels
stale validated Version information for this issue has been validated

Comments

@cmanaila60
Copy link

Summary

#2034 this issue is reoccurring with the latest sf cli

Steps To Reproduce

Running the below:
sf apex run test -r json -w 30 -l RunLocalTests

Expected result

Should run async tests

Actual result

It's running synchronous tests

System Information

zsh

{
  "architecture": "darwin-x64",
  "cliVersion": "@salesforce/cli/2.37.4",
  "nodeVersion": "node-v21.7.3",
  "osVersion": "Darwin 23.3.0",
  "rootPath": "/Users/mma3292/.npm-global/lib/node_modules/@salesforce/cli",
  "shell": "zsh",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.0.13 (core)",
    "@oclif/plugin-commands 3.2.2 (core)",
    "@oclif/plugin-help 6.0.20 (core)",
    "@oclif/plugin-not-found 3.1.2 (core)",
    "@oclif/plugin-plugins 5.0.7 (core)",
    "@oclif/plugin-search 1.0.20 (core)",
    "@oclif/plugin-update 4.2.4 (core)",
    "@oclif/plugin-version 2.0.16 (core)",
    "@oclif/plugin-warn-if-update-available 3.0.15 (core)",
    "@oclif/plugin-which 3.1.7 (core)",
    "@salesforce/cli 2.37.4 (core)",
    "apex 3.1.4 (core)",
    "auth 3.5.5 (core)",
    "data 3.2.5 (core)",
    "deploy-retrieve 3.5.6 (core)",
    "env 2.1.8 (user)",
    "info 3.1.3 (core)",
    "limits 3.2.1 (core)",
    "marketplace 1.1.1 (core)",
    "org 4.0.4 (core)",
    "packaging 2.3.0 (core)",
    "schema 3.2.1 (core)",
    "settings 2.1.2 (core)",
    "sobject 1.2.2 (core)",
    "source 3.2.3 (core)",
    "telemetry 3.1.18 (core)",
    "templates 56.1.1 (core)",
    "trust 3.5.4 (core)",
    "user 3.4.3 (core)"
  ]
@cmanaila60 cmanaila60 added the investigating We're actively investigating this issue label Apr 22, 2024
Copy link

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.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Apr 22, 2024
@WillieRuemmele
Copy link
Member

Hi @cmanaila60 -

a few questions:

  • Do you mean a difference in the WAY tests are ran (async vs synchronous) - there's two different endpoints, with different limitations (search for "runTest")
    • if so, how are you verifying this?
  • A difference in command output or behavior?

do you have a before and after example?

the terms for back end test execution, and command execution are the same, I'm just confused on which one you mean changed

@cmanaila60
Copy link
Author

I probably should've wrote more details. I'm running this from GitHub actions and from my local machine.
Usually:
sf org login sfdx-url ...
sf apex run test ...

  • I mean a difference in the way tests are ran. That command will always run them synchronous
    • First I verified visually in the org that the tests are run in parallel since they finish in 3-4 mins. We have over 1500 and they usually take about 30 mins.
    • 2nd If I enable Setup > Apex Test Execution > Options > Disable Parallel Apex Testing the tests will run async
  • the difference is in the behaviour of the command. I would expect to add --synchronous to run the tests in parallel. As I see there is no way to make it run async tests.

@WillieRuemmele
Copy link
Member

hi @cmanaila60 - sorry I missed your response until now.

I have a few more questions based on your response:

  • Did they used to take 30 mins to run? or 3-4 Mins? What was the previous behavior, and what is the current behavior?
    • If they took 30, and now take 3, is that bad?
  • The only way to get tests to run synchronously, is by providing the --synchronous flag and --testlevel=RunSpecifiedTests
  • was the last version this worked correctly for you, sf 2.36.x?

@mdonnalley mdonnalley added stale and removed investigating We're actively investigating this issue labels May 15, 2024
@iowillhoit
Copy link
Contributor

Closing stale issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

4 participants