-
Notifications
You must be signed in to change notification settings - Fork 273
Please execute data driven unit tests sequentially while debugging, not in parallel #5484
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
Comments
I don't think we should influence how execution works based on whether or not debugger is attached. You can either temporarily disable parallelization altogether, or freeze the other threads. See Freeze and thaw thread execution. I'm going to close as by-design. |
That approach seems very cumbersome to take with every single debugging session. May suggest to extend the |
Setting parallelization options in project file is tracked by #4116. Having a new ExecutionScope for Parallelize attribute may be something to consider. I guess something like Meanwhile, I'm curious if maybe specifying Or maybe what we should fix here is the ability to run single test case altogether. Re-opening to track the other suggestions. But I still think the original suggestion isn't something we should attempt to do. |
Another option, when using MTP, would be to have an explicit program.cs and to have a pragma limiting the max parallelism to one when debugging. @Youssef1313 this is what we did when we were using TATF. |
Yes that seems like a good problem to solve. But I can also see having a button in the UI, for |
Summary
Currently, debugging data driven unit tests is hell, because all of a data driven test method’s variations are run in parallel.
It’s impossible to debug a particular test scenario then.
Example
Background and Motivation
When debugging a data driven unit test and hitting F10, F11 or F5 on a breakpoint, it's not the next instruction within the same text execution that the debugger halts. Instead, it's the next instruction from another data driven test within the same method.
Given there are multiple data rows, it's impossible to follow what's going on.
Proposed Feature
During debugging, data driven tests should never run in parallel.
/ref: https://developercommunity.visualstudio.com/t/MS-Test:-Please-execute-data-driven-unit/10841744
The text was updated successfully, but these errors were encountered: