Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@
File.WriteAllText(filename, $"#!/bin/sh\nsleep 600\n"); // sleep 10 min.
File.SetUnixFileMode(filename, ExecutablePermissions);

using (var process = Process.Start(new ProcessStartInfo { FileName = filename }))
using SafeFileHandle nullHandle = File.OpenNullHandle();

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTestsCoreCLR)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_EAT)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug CoreCLR_Libraries)

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs#L176

src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs(176,19): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'SafeFileHandle' could not be found (are you missing a using directive or an assembly reference?)
ProcessStartInfo psi = new(filename)
{
StandardOutputHandle = nullHandle,
StandardErrorHandle= nullHandle
};
using (var process = Process.Start(psi))
{
try
{
Expand All @@ -186,7 +192,7 @@
}
finally
{
process.Kill();
process.Kill(entireProcessTree: true);
process.WaitForExit();
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2499,7 +2499,13 @@ public void LongProcessNamesAreSupported()
string sleepCommandPathFileName = Path.Combine(TestDirectory, LongProcessName);
File.Copy(sleepPath, sleepCommandPathFileName);

using (Process px = Process.Start(sleepCommandPathFileName, "600"))
using SafeFileHandle nullHandle = File.OpenNullHandle();
ProcessStartInfo psi = new(sleepCommandPathFileName, "600")
{
StandardOutputHandle = nullHandle,
StandardErrorHandle= nullHandle
};
Comment thread
adamsitnik marked this conversation as resolved.
using (Process px = Process.Start(psi))
{
// Reading of long process names is flaky during process startup and shutdown.
// Wait a bit to skip over the period where the ProcessName is not reliable.
Expand All @@ -2512,7 +2518,7 @@ public void LongProcessNamesAreSupported()
}
finally
{
px.Kill();
px.Kill(entireProcessTree: true);
Comment thread
adamsitnik marked this conversation as resolved.
px.WaitForExit();
}
}
Expand Down
Loading