From 37d743afcc875f3a845281b680c6e2ce4c7dda3d Mon Sep 17 00:00:00 2001 From: joshudson Date: Tue, 1 Oct 2019 15:53:50 -0700 Subject: [PATCH] Don't display any GUI during test run. (dotnet/corefx#38042) Commit migrated from https://github.com/dotnet/corefx/commit/6c892a14e4da5e1ec0c5c766c7625c4d2d51ffb6 --- src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs index 2b1529e..084501e 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs @@ -229,7 +229,9 @@ namespace System.Diagnostics.Tests } // Open a file that doesn't exist with an argument that xdg-open considers invalid. - using (var px = Process.Start(new ProcessStartInfo { UseShellExecute = true, FileName = "/nosuchfile", Arguments = "invalid_arg" })) + var startInfo = new ProcessStartInfo { UseShellExecute = true, FileName = "/nosuchfile", Arguments = "invalid_arg" }; + startInfo.Environment.Remove("DISPLAY"); // Get rid of DISPLAY environment variable as this causes spurious test failures. + using (var px = Process.Start(startInfo)) { Assert.NotNull(px); px.WaitForExit(); -- 2.7.4