-
Notifications
You must be signed in to change notification settings - Fork 675
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
Can't debug unit tests on VS2015 RC #23
Comments
It looks like they have completely reworked the test executor. It is a differently named process now, but the real problem is that it also has a different command line, which doesn't contain the /parentProcessId switch which we used to parse to get back to VS (and it doesn't contain any replacement, either). We'll need to find some other way to communicate with the VS process... |
Side note: it looks like we can replace the current double-attach scheme with attaching directly to python.exe if we provide our own ITestExecutorLauncher. We can do so by exporting our own IUpdateTestRunConfiguration via MEF, and replacing the standard launcher with our own. |
I'm not sure that particular approach is feasible, but since we define our own test type then we may be able to gain that control by installing a test adapter too (more like VSTestHost than our current adapter). Still won't get us running in-proc, unfortunately, so building new UI is still looking more attractive... |
Use an environment variable to propagate process ID of devenv.exe to the test executor process, instead of relying on a command line switch to the latter that is no longer present in VS 2015.
Pavel, with your fix in progress linked above, how does it behave when multiple instances of VS are running? I would guess there's a race condition if you try to debug tests in multiple VS around the same time, but if that's the only scenario that causes issues, it's better than no debugging at all. |
There shouldn't be any race there. The test executor process gets the process ID of the VS instance that launched it, and attaches back to it - same as we did before, except that we're now using a different way to propagate that process ID. |
Environment variables are local to the process and its child processes, though there may be a case where we reuse a test executor started from (say) C# that does not see the variable. Though it'll probably crash and restart, thereby picking up our variable. Something to test:
If that works, I don't see anywhere else that may be a problem here. It's much more robust than the previous approach. |
Looking at it in debugger, our package gets loaded on VS startup, so we always set that variable before anyone will get a chance to trigger a test run. |
Fix #23: Can't debug unit tests on VS2015 RC
VS 2015 22822.1 D14REL
PTVS 2.2 CL1457733_VS2015_22820
Create python app
Add item, unit test
Put a breakpoint on
a = 0
.Debug test
Occasionally, I get this access violation exception (debugger breaks).
But most of the time, it runs without debugging. You don't see the "2nd attach" happening at all. This is worse than with CTP 6 where it would sometimes work as expected (debug and stop at that breakpoint), sometimes get the access violation.
I tried C# and C++ (native) unit test debugging, and haven't had seen any issue yet.
The text was updated successfully, but these errors were encountered: