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

Test Classes should support IAsyncDisposable in addition to IDisposable. #1164

Closed
invino4 opened this issue May 26, 2020 · 0 comments · Fixed by #1288
Closed

Test Classes should support IAsyncDisposable in addition to IDisposable. #1164

invino4 opened this issue May 26, 2020 · 0 comments · Fixed by #1288
Assignees
Milestone

Comments

@invino4
Copy link

invino4 commented May 26, 2020

Description

IMPORTANT: if the defect is reproduced only in a workflow from within the Visual Studio IDE then do not report the issue here - instead, please report it using Visual Studio's "Send Feedback" option that can be accessed from the Help menu OR using this link https://developercommunity.visualstudio.com.

For a defect reproducable from the vstest command line, describe the issue you've observed.

Steps to reproduce

What steps can reproduce the defect?
Please share the setup, commandline for vstest.console, sample project, target
framework etc.

    [TestClass]
    public sealed class SomeTests : IAsyncDisposable
    {
        public ValueTask DisposeAsync()
        {
            // should be called during test cleanup.
        }
    }

Expected behavior

Share the expected output
The DisposeAsync method should be called during test cleanup in the same manner as the Dispose method from IDisposable is called. Either Dispose, DisposeAsync or both can be implemented by the test class. If both are implemented then DisposeAsync should be preferred. Only one is actually called.

Actual behavior

What is the behavior observed?
DisposeAsync is ignored and never executed. See code here.

Diagnostic logs

Please share test platform diagnostics logs. Instructions to collect logs are here.
The logs may contain test assembly paths, kindly review and mask those before sharing.

Environment

Please share additional details about the test environment.
Operating system, Build version of vstest.console

AB#1634620

@nohwnd nohwnd transferred this issue from microsoft/vstest Aug 2, 2022
@Evangelink Evangelink added this to the 3.0.0 milestone Sep 12, 2022
@engyebrahim engyebrahim self-assigned this Sep 27, 2022
@Evangelink Evangelink modified the milestones: 4.0.0, 3.0.0 Feb 7, 2023
@Evangelink Evangelink removed the sprint label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants