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

Dispose of processes launched in host tests #69625

Merged
merged 2 commits into from
May 23, 2022

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented May 20, 2022

There have been intermittent failures where the host tests fail to clean up with UnauthorizedAccessException for an executable we launch. Examples:

It seems the host test don't dispose any of the processes they launch. This change makes the Command.WaitForExit helper dispose of the underlying process. All the tests should go through this. We could also make Command disposable, but that makes the usage in all the tests more awkward with the current pattern of chained invokes/assertions.

This also switches some of the tests to use the TestArtifact helper class for cleaning up a test directory.

@elinor-fung elinor-fung added test-bug Problem in test source code (most likely) area-Host labels May 20, 2022
@elinor-fung elinor-fung requested a review from vitek-karas May 20, 2022 20:48
@ghost ghost assigned elinor-fung May 20, 2022
@ghost
Copy link

ghost commented May 20, 2022

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

There have been intermittent failures where the host tests fail to clean up with UnauthorizedAccessException for an executable we launch. Examples:

This change makes the Command.WaitForExit helper dispose of the underlying process. All the tests should go through this. We could also make Command disposable, but that makes the usage in all the tests more awkward with the current pattern of chained invokes/assertions.

This also switches some of the tests to use the TestArtifact helper class for cleaning up a test directory.

Author: elinor-fung
Assignees: -
Labels:

test-bug, area-Host

Milestone: -

Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@elinor-fung elinor-fung merged commit 43cdb74 into dotnet:main May 23, 2022
@elinor-fung elinor-fung deleted the hostTestDispose branch May 23, 2022 17:36
@ghost ghost locked as resolved and limited conversation to collaborators Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host test-bug Problem in test source code (most likely)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants