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

Ensure to send a session complete event #4878

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update a comment
  • Loading branch information
drognanar committed Feb 20, 2024
commit 0fd3b3f7b18b5c5c551e4a5617ed139a749a0191
9 changes: 6 additions & 3 deletions src/vstest.console/TestPlatformHelpers/TestRequestManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,12 @@ public void StartTestSession(
var testSessionStarted = _testPlatform.StartTestSession(requestData, criteria, eventsHandler, sourceToSourceDetailMap, new NullWarningLogger());
if (!testSessionStarted)
{
// Note: StartTestSession will invoke the HandleStartTestSessionComplete event
// if the test session is started successfully. If it is not started, we need
// to invoke the event here.
// Note: We need to send back a TestSessionComplete event, so that the caller
// completes a session start request.
// StartTestSession will invoke the HandleStartTestSessionComplete event
// if the test session is started successfully. However, if it is not started,
// HandleStartTestSessionComplete will not send an event. That's why we need
// to do it here.
eventsHandler.HandleStartTestSessionComplete(new());
EqtTrace.Warning("TestRequestManager.StartTestSession: Unable to start test session.");
}
Expand Down