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

Unable to run CTest in parallel #3812

Closed
Jepsson opened this issue Jun 4, 2024 · 3 comments
Closed

Unable to run CTest in parallel #3812

Jepsson opened this issue Jun 4, 2024 · 3 comments

Comments

@Jepsson
Copy link

Jepsson commented Jun 4, 2024

Brief Issue Summary

After updating to v1.18(from v1.17) I am unable to run our google tests using the "Run CTest" button in the status bar,

I am using a CMakePresets.json which looks like this:

"testPresets": [
        {
            "name": "unit-test",
            "execution": {
                "jobs": 16
            },
            "configurePreset": "unit_test"
        }
]

and also setting "cmake.ctest.allowParallelJobs": true

In version v1.18
Ctest command generated: /usr/bin/ctest -T test --output-on-failure --parallel 16 -j18 -R ^<big chunk of tests>
Output from command:

[ctest] RegularExpression::compile(): Expression too big.
[ctest] No tests were found!!!

In version v1.17
Ctest command generated: /usr/bin/ctest -T test --output-on-failure --parallel 16

other info
If I set "cmake.ctest.allowParallelJobs": false I can run the tests but they take ages to run(~1700 tests), and when running in parallell it takes ~4 seconds.
It also seems very strange that the extension adds a flag(--parallel 16) for my specified number of jobs in CMakePresets.json and also a flag(-j18) when setting allowParallelJobs to true.

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.89.1",
  "cmtVersion": "1.18.41",
  "configurations": [
    {
      "folder": "/home/jepsson/git/repoxxx",
      "cmakeVersion": "3.16.3",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": true,
      "compilers": {
        "C": "/usr/bin/clang-12",
        "CXX": "/usr/bin/clang++-12"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 126,
    "executablesCount": 1,
    "librariesCount": 36,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

Debug Log

No response

Additional Information

No response

@gcampbell-msft
Copy link
Collaborator

@Jepsson Hi, we're having conversation about this regression in this issue as well: #3804. I'm going to close this one as a duplicate, but please see this comment and try to install the vsix (after renaming from a .zip), and see if it fixes your issue. If it does, then I'll create a merge a PR. Thanks!

@github-project-automation github-project-automation bot moved this from Triage Needed to Completed in CMake Tools Jun 4, 2024
@gcampbell-msft
Copy link
Collaborator

@Jepsson Could you confirm that the vsix in that comment fixes your issue?

@Jepsson
Copy link
Author

Jepsson commented Jun 5, 2024

@gcampbell-msft I have installed the vsix and it works, thank you!
It's still a bit strange that the ctest command includes the "--parallel/-j" flag two times, i.e. /usr/bin/ctest -T test --output-on-failure --parallel 16 -j18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

No branches or pull requests

2 participants