Skip to content

Commit ece47e9

Browse files
committed
Dispose _psesProcess in DAP tests
1 parent 7252de6 commit ece47e9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using System;
@@ -19,7 +19,7 @@
1919
namespace PowerShellEditorServices.Test.E2E
2020
{
2121
[Trait("Category", "DAP")]
22-
public class DebugAdapterProtocolMessageTests : IAsyncLifetime
22+
public class DebugAdapterProtocolMessageTests : IAsyncLifetime, IDisposable
2323
{
2424
private const string TestOutputFileName = "__dapTestOutputFile.txt";
2525
private static readonly bool s_isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
@@ -104,7 +104,13 @@ await PsesDebugAdapterClient.RequestDisconnect(new DisconnectArguments
104104
TerminateDebuggee = true
105105
}).ConfigureAwait(true);
106106
await _psesProcess.Stop().ConfigureAwait(true);
107+
}
108+
109+
public void Dispose()
110+
{
111+
GC.SuppressFinalize(this);
107112
PsesDebugAdapterClient?.Dispose();
113+
_psesProcess?.Dispose();
108114
}
109115

110116
private static string NewTestFile(string script, bool isPester = false)

0 commit comments

Comments
 (0)