Repro steps
This can be for example tested on https://github.com/microsoft/vs-streamjsonrpc, by forcing vstest mode in the test project:
<DisableTestingPlatformServerCapability>true</DisableTestingPlatformServerCapability>
<TestingPlatformDotnetTestSupport>false</TestingPlatformDotnetTestSupport>
<UseMicrosoftTestingPlatformRunner>false</UseMicrosoftTestingPlatformRunner>
If a user triggers a run in test explorer and then stops it mid-run, the test runner does not finish running it immediately.
It keeps running until completion. This causes file locking issues to appear.
Expected
vstest and testhosts pass in the parentprocessid, so that the child process closes immediately as soon as the parent closes.
if xunit test process would similarly pass in the parent process id, it could also detect parent closing and close immediately.