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

ITestExecutor Cancel does not appear to be called #4329

Closed
jpribele opened this issue Feb 27, 2023 · 5 comments
Closed

ITestExecutor Cancel does not appear to be called #4329

jpribele opened this issue Feb 27, 2023 · 5 comments
Labels
by-design needs-triage This item should be discussed in the next triage meeting.

Comments

@jpribele
Copy link

Description

The Cancel method of an ITestExecutor does not appear to be called

Steps to reproduce

Create an implementation of ITestExecuter
Create a long running test that test executer would execute
Run a the long running test
Hit the cancel button in the text explorer

Expected behavior

Cancel method is invoke

Actual behavior

Nothing

Diagnostic logs

Environment

Visual Studio 2022 Version 17.5.0

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage This item should be discussed in the next triage meeting. label Feb 27, 2023
@MikeSchulze
Copy link

MikeSchulze commented Feb 24, 2024

I run into the same issue public void Cancel() is not called when pressing the stop button on Test Explorer
But on console it shows
========== Test run aborted: 1 Tests (1 Passed, 0 Failed, 0 Skipped) run in < 1 ms ==========

@nohwnd
Copy link
Member

nohwnd commented Jul 9, 2024

This is by-design (or rather: too late to change it now).

@nohwnd nohwnd closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
@MikeSchulze
Copy link

You're not serious now, are you?

The ITestExecutor is an official interface and should be supported by default!
https://github.com/microsoft/vstest/blob/main/src/Microsoft.TestPlatform.ObjectModel/Adapter/Interfaces/ITestExecutor.cs

The answer is probably below par ...

@nohwnd
Copy link
Member

nohwnd commented Jul 10, 2024

I am not, this was done to keep the interactive experience in VS responsive. When abort is pressed everything tears down as fast as possible.

@MikeSchulze
Copy link

The problem is that if a test hangs for some unknown reason, it must be possible to cancel the test execution. Otherwise, this would mean I would have to close and reopen the IDE to solve the problem, which is very inconvenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by-design needs-triage This item should be discussed in the next triage meeting.
Projects
None yet
Development

No branches or pull requests

3 participants