don't try to test module path if we can't load the module (#57590)
authorAdam Sitnik <adam.sitnik@gmail.com>
Tue, 17 Aug 2021 20:48:02 +0000 (22:48 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Aug 2021 20:48:02 +0000 (22:48 +0200)
src/libraries/System.Diagnostics.Process/tests/ProcessModuleTests.Windows.cs

index ca5360e..5e3a8cc 100644 (file)
@@ -36,9 +36,7 @@ namespace System.Diagnostics.Tests
             IntPtr moduleHandle = Interop.Kernel32.LoadLibrary(longNamePath);
             if (moduleHandle == IntPtr.Zero)
             {
-                Assert.Equal(126, Marshal.GetLastWin32Error()); // ERROR_MOD_NOT_FOUND
-                Assert.Equal(Architecture.X86, RuntimeInformation.ProcessArchitecture);
-                return; // we have failed to load the module on x86, we skip the rest of the test (it's best effort)
+                return; // we've failed to load the module, we can't test module paths
             }
 
             try