Skip to content

Fix failure to dispose RemoteWorkspace in tests#48077

Merged
sharwell merged 1 commit intodotnet:masterfrom
sharwell:dispose-remote-workaround
Sep 28, 2020
Merged

Fix failure to dispose RemoteWorkspace in tests#48077
sharwell merged 1 commit intodotnet:masterfrom
sharwell:dispose-remote-workaround

Conversation

@sharwell
Copy link
Contributor

This pull request implements the target functionality from #48069 using a workaround for a case where #47951 is not yet merged. If the latter change is approved, this pull request is no longer necessary.

Disposing of the RemoteWorkspace instance provides a tremendous performance advantage during test cleanup.

@sharwell sharwell requested a review from a team as a code owner September 26, 2020 01:27
// Directly dispose IRemoteHostClientProvider if necessary. This is a test hook to ensure RemoteWorkspace
// gets disposed in unit tests as soon as TestWorkspace gets disposed. This would be superseded by direct
// support for IDisposable in https://github.com/dotnet/roslyn/pull/47951.
if (Services.GetService<IRemoteHostClientProvider>() is IDisposable disposableService)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📝 My one concern here is what happens if this triggers the JIT to try and load one of our optional dependencies which isn't relevant for typical command line Workspace usage. I couldn't find any direct indication that this would occur, but the possibility leaves me with a preference towards #47951 which is a much cleaner approach.

@sharwell
Copy link
Contributor Author

@jasonmalinowski @CyrusNajmabadi I'm merging this to unblock the performance advantage. It needs to be cleaned up by #47951 and then #48069.

@sharwell sharwell merged commit 5adae17 into dotnet:master Sep 28, 2020
@ghost ghost added this to the Next milestone Sep 28, 2020
@sharwell sharwell deleted the dispose-remote-workaround branch September 28, 2020 15:09
@Cosifne Cosifne modified the milestones: Next, 16.9.P1 Oct 12, 2020
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 this pull request may close these issues.

3 participants