Skip to content

Commit fed3efb

Browse files
committed
Refactor process handling in AppiumLocalServiceTests
Removed the `using` statement for the current process in `AppiumLocalServiceTests.cs`, allowing it to be referenced without disposal. This simplifies the code while maintaining the functionality to test graceful shutdown behavior on Windows.
1 parent 54d3cb5 commit fed3efb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/integration/ServerTests/AppiumLocalServiceTests.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ public void TryGracefulShutdownOnWindows_ReturnsFalse_WhenNotWindows()
111111
var service = CreateService();
112112
var method = GetTryGracefulShutdownOnWindows();
113113

114-
// Use a running process (self)
115-
using (var proc = Process.GetCurrentProcess())
116-
{
117-
var result = (bool)method.Invoke(service, new object[] { proc, 5000 });
118-
Assert.That(result, Is.False);
119-
}
114+
// Use a running process (self) without disposing it
115+
var proc = Process.GetCurrentProcess();
116+
var result = (bool)method.Invoke(service, new object[] { proc, 5000 });
117+
Assert.That(result, Is.False);
120118
}
121119

122120
[Test]

0 commit comments

Comments
 (0)