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

Issues when running tests in parallel #3655

Closed
Tymon13 opened this issue Mar 14, 2024 · 3 comments
Closed

Issues when running tests in parallel #3655

Tymon13 opened this issue Mar 14, 2024 · 3 comments
Assignees
Labels
bug a bug in the product documentation related to documentation of the extension Feature: ctest more info needed More info is needed from the community for us to properly triage and investigate.
Milestone

Comments

@Tymon13
Copy link

Tymon13 commented Mar 14, 2024

Brief Issue Summary

This is sort of follow-up to #3091. I have two, possibly related issues:

Tests do not follow the philosophy "Visual Studio Code settings do not change preset behaviour"

The doc states

To invoke CTest, run CMake: Run Tests from the command palette. This is the same as running ctest --preset <testPreset> from the command line, where <testPreset> is the name of the active Test Preset.

and

CMakePresets.json should be the source of truth for all settings related to configure, build, and test. This eliminates behavior specific to Visual Studio Code and ensures that your CMake and CTest invocations can be reproduced from the command line.

Neither of these is true unless user has specifically set "cmake.ctest.allowParallelJobs": true, in settings (defaults to false). If this setting is not on, CMake: Run Tests does the following:

for test in $detected_tests
do
    ctest --preset <testPreset> -R $test
done

While this does pass --parallel N if preset has "execution": {"jobs": N}, that option does nothing since there is only one test executing due to -R effect.
I don't know what the correct action is. Preferably, the behaviour should stick to the philosophy of "settings do not interfere with presets" and either the setting should be true by default or removed altogether (since it does affect running tests outside of CMakePresets.json).

CMake: Run Tests and Tests: Run All Tests have different behaviour

Once I do set "cmake.ctest.allowParallelJobs": true,, CMake: Run Tests and clicking the flask in CMake tab does execute tests in parallel as expected, but Tests: Run All Tests and clicking "Run Tests" in "Testing" tab does not execute tests in parallel, as if ignoring cmake.ctest.allowParallelJobs completely.
While not a critical issue, this prevents use of Testing tab and access to nice visual test results.

I didn't include Log diagnostics nor debug logs, since they don't seem very useful and I'd have to strip them of protected information first. If you need them, I can provide it to you.

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@gcampbell-msft
Copy link
Collaborator

@Tymon13 Thanks for posting the issue. It sounds like, at the very least, we need to make sure that our docs are up-to-date with our actual implementation. Additionally, we need to continue investigating our testing implementation.

@xisui-MSFT FYI.

@gcampbell-msft gcampbell-msft added bug a bug in the product Feature: ctest and removed triage labels Mar 15, 2024
@gcampbell-msft gcampbell-msft added this to the Backlog milestone Mar 15, 2024
@gcampbell-msft
Copy link
Collaborator

@Tymon13 Could you update to the most recent pre-release version and confirm whether these findings are still accurate? We recently merged #3577 and I'm curious about what affects it has on this issue. Thanks.

@gcampbell-msft
Copy link
Collaborator

Either way, we have multiple reasons for running the tests like we do. Specifically, without the allowParallelJobs setting enabled, we want to run each test individually so that the Test Explorer can correctly track progress (assuming the test explorer integration is turned on). With the allowParallelJobs setting enabled, we run in parallel, but the Test Explorer may not track progress as well.

With these things in mind, I think this is simply a documentation bug, but I'd like to get your feedback in order to confirm this.

@gcampbell-msft gcampbell-msft added the documentation related to documentation of the extension label Apr 23, 2024
@gcampbell-msft gcampbell-msft modified the milestones: Backlog, 1.18 Apr 23, 2024
@gcampbell-msft gcampbell-msft added the more info needed More info is needed from the community for us to properly triage and investigate. label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product documentation related to documentation of the extension Feature: ctest more info needed More info is needed from the community for us to properly triage and investigate.
Projects
Status: Completed
Development

No branches or pull requests

3 participants