Repository navigation
Closed
Description
Several System.Diagnostics.Tests tests fail on windows with the following output:
System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_BadVerb(useShellExecute: True) [FAIL]
Assert.Throws() Failure
Expected: typeof(System.ComponentModel.Win32Exception)
Actual: typeof(System.InvalidOperationException): Failed to set the specified COM apartment state.
---- System.InvalidOperationException : Failed to set the specified COM apartment state.
Stack Trace:
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessStartInfoTests.cs(1095,0): at System.Diagnostics.Tests.ProcessStartInfoTests.<>c__DisplayClass48_0.<StartInfo_BadVerb>b__0()
----- Inner Stack Trace -----
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessStartInfoTests.cs(1095,0): at System.Diagnostics.Tests.ProcessStartInfoTests.<>c__DisplayClass48_0.<StartInfo_BadVerb>b__0()
System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_BadExe(useShellExecute: True) [FAIL]
Assert.Throws() Failure
Expected: typeof(System.ComponentModel.Win32Exception)
Actual: typeof(System.InvalidOperationException): Failed to set the specified COM apartment state.
---- System.InvalidOperationException : Failed to set the specified COM apartment state.
Stack Trace:
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessStartInfoTests.cs(1118,0): at System.Diagnostics.Tests.ProcessStartInfoTests.<>c__DisplayClass49_0.<StartInfo_BadExe>b__0()
----- Inner Stack Trace -----
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessStartInfoTests.cs(1118,0): at System.Diagnostics.Tests.ProcessStartInfoTests.<>c__DisplayClass49_0.<StartInfo_BadExe>b__0()
System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_Executes(filenameAsUrl: True) [FAIL]
System.InvalidOperationException : Failed to set the specified COM apartment state.
Stack Trace:
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessTests.cs(247,0): at System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_Executes(Boolean filenameAsUrl)
_\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs(359,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_Executes(filenameAsUrl: False) [FAIL]
System.InvalidOperationException : Failed to set the specified COM apartment state.
Stack Trace:
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessTests.cs(247,0): at System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_Executes(Boolean filenameAsUrl)
_\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs(359,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_WorkingDirectory [FAIL]
System.InvalidOperationException : Failed to set the specified COM apartment state.
Stack Trace:
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessTests.cs(309,0): at System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_WorkingDirectory()
_\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs(359,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Unhandled Exception:
System.InvalidOperationException: Failed to set the specified COM apartment state.
at System.Threading.Thread.SetApartmentState(ApartmentState state) in _\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs:line 234
at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread() in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs:line 180
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs:line 90
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs:line 25
at System.Diagnostics.Process.Start() in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs:line 1221
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs:line 1270
at System.Diagnostics.Tests.ProcessTests.<ProcessStart_UseShellExecute_ExecuteOrder>b__13_0(String pathDirectory) in _\src\libraries\System.Diagnostics.Process\tests\ProcessTests.cs:line 279
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in _\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs:line 359
--- End of stack trace from previous location ---
at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args) in /_/src/Microsoft.DotNet.RemoteExecutor/src/Program.cs:line 95
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Failed to set the specified COM apartment state.
at System.Threading.Thread.SetApartmentState(ApartmentState state) in _\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs:line 234
at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread() in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs:line 180
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs:line 90
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs:line 25
at System.Diagnostics.Process.Start() in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs:line 1221
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) in _\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs:line 1270
at System.Diagnostics.Tests.ProcessTests.<ProcessStart_UseShellExecute_ExecuteOrder>b__13_0(String pathDirectory) in _\src\libraries\System.Diagnostics.Process\tests\ProcessTests.cs:line 279
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in _\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs:line 359
--- End of stack trace from previous location ---
at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args) in /_/src/Microsoft.DotNet.RemoteExecutor/src/Program.cs:line 95
Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception.
System.Diagnostics.Tests.ProcessTests.ProcessStart_UseShellExecute_ExecuteOrder [FAIL]
Stack Trace:
Child exception:
System.InvalidOperationException: Failed to set the specified COM apartment state.
_\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs(234,0): at System.Threading.Thread.SetApartmentState(ApartmentState state)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(180,0): at System.Diagnostics.Process.ShellExecuteHelper.ShellExecuteOnSTAThread()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(90,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1221,0): at System.Diagnostics.Process.Start()
_\src\libraries\System.Diagnostics.Process\src\System\Diagnostics\Process.cs(1270,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
_\src\libraries\System.Diagnostics.Process\tests\ProcessTests.cs(279,0): at System.Diagnostics.Tests.ProcessTests.<ProcessStart_UseShellExecute_ExecuteOrder>b__13_0(String pathDirectory)
_\src\mono\netcore\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs(359,0): at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Child process:
System.Diagnostics.Process.Tests, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 System.Diagnostics.Tests.ProcessTests Int32 <ProcessStart_UseShellExecute_ExecuteOrder>b__13_0(System.String)
Child arguments:
C:\Users\user\AppData\Local\Temp\ProcessTests_3yhpoi2n.iir\Path
The failing tests will be marked with ActiveIssue in #32592.
Activity
danmoseley commentedon Apr 10, 2020
dupe #34360