Skip to content

[mono] Tests failed on windows: System.Diagnostics.Tests #34685

Closed

Description

@MaximLipnin

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

  1. added
    untriaged
    on Apr 8, 2020
  2. danmoseley commented on Apr 10, 2020

    @danmoseley
    Contributor

    dupe #34360

  3. removed
    untriaged
    on Sep 17, 2020
  4. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions