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

Async APIs not working #4592

Closed
Cyberboss opened this issue Jul 7, 2023 · 3 comments · Fixed by #4648
Closed

Async APIs not working #4592

Cyberboss opened this issue Jul 7, 2023 · 3 comments · Fixed by #4648

Comments

@Cyberboss
Copy link

Cyberboss commented Jul 7, 2023

Description

VsTestConsoleWrapper.StartSessionAsync() never succeeds.

You're awaiting the handshake task here:

await Task.Run(() =>
_communicationManager.AcceptClientAsync(), timeoutSource.Token).ConfigureAwait(false);
_handShakeSuccessful = await HandShakeWithVsTestConsoleAsync().ConfigureAwait(false);

Before actually starting the console process here:

_vstestConsoleProcessManager.StartProcess(_consoleParameters);

Steps to reproduce

var testConsoleWrapper = new VsTestConsoleWrapper(executable);
await testConsoleWrapper.StartSessionAsync();

Expected behavior

The Task returned by StartSessionAsync() eventually completes.

Actual behavior

The Task returned by StartSessionAsync() eventually never completes.

Diagnostic logs

None

Environment

vstest.console.exe version: 17.0.33007.217
Target .NET version: net472

PS C:\Users\Cyberboss> dotnet --list-sdks
1.1.10 [C:\Program Files\dotnet\sdk]
1.1.14 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.526 [C:\Program Files\dotnet\sdk]
5.0.202 [C:\Program Files\dotnet\sdk]
5.0.214 [C:\Program Files\dotnet\sdk]
5.0.404 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
6.0.313 [C:\Program Files\dotnet\sdk]
6.0.410 [C:\Program Files\dotnet\sdk]
7.0.100 [C:\Program Files\dotnet\sdk]
7.0.304 [C:\Program Files\dotnet\sdk]

AB#1865062

@nohwnd nohwnd changed the title VsTestConsoleWrapper.StartSessionAsync() never succeeds. Async APIs not working Jul 10, 2023
@nohwnd
Copy link
Member

nohwnd commented Jul 10, 2023

This is a long standing issue with the async api, they don't work, and are not really async in the sense that we understand them now (not blocking threads).

There have been few attempts to fix this (from my side) but it needs the api to be fully redesigned to avoid additional hacks.

@nohwnd
Copy link
Member

nohwnd commented Jul 10, 2023

We are discussing if we should make a breaking change and fix them, or make them obsolete, because in the current form you don't get any additional benefit of using them, they do async over sync.

@nohwnd
Copy link
Member

nohwnd commented Aug 3, 2023

We decided to make them obsolete, because the apis don't work, and were not designed for what is nowadays understood as Async. We would have to redesign and completely rewrite the client to follow async practices, which is not something we can commit to right now.

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

Successfully merging a pull request may close this issue.

3 participants