Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures: System.Diagnostics.Tests.ProcessStartInfoTests on windows.11.amd64.clientpre #60191

Open
CarnaViire opened this issue Oct 8, 2021 · 1 comment
Labels
area-System.Diagnostics.Process needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration
Milestone

Comments

@CarnaViire
Copy link
Member

StartInfo_NotepadWithContent and StartInfo_NotepadWithContent_withArgumentList fail with the following

Assert.Equal() Failure
          ↓ (pos 0)
Expected: notepad
Actual:   Notepad
          ↑ (pos 0)
Date Count Branch
4 2021-10-08 PR #60173
4 2021-10-07 PR #59925
4 2021-10-01 PR #59475
4 2021-09-28 PR #59712
4 2021-09-21 PR #59204
4 2021-09-16 PR #51736
4 2021-09-14 PR #57634
4 2021-09-13 PR #58922
8 2021-09-10 PR #58922, PR #57324
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Diagnostics.Process untriaged New issue has not been triaged by the area owner labels Oct 8, 2021
@jeffhandley jeffhandley added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed untriaged New issue has not been triaged by the area owner labels Oct 9, 2021
@jeffhandley jeffhandley added this to the Future milestone Oct 9, 2021
@am11
Copy link
Member

am11 commented Oct 16, 2021

--- a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs
+++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs
@@ -1318,7 +1318,7 @@ private void VerifyNotepadMainWindowTitle(Process process, string filename)
             string expected = Path.GetFileNameWithoutExtension(filename);

             process.WaitForInputIdle(); // Give the file a chance to load
-            Assert.Equal("notepad", process.ProcessName);
+            Assert.Equal("notepad", process.ProcessName, ignoreCase: true);

             // Notepad calls CreateWindowEx with pWindowName of empty string, then calls SetWindowTextW
             // with "Untitled - Notepad" then finally if you're opening a file, calls SetWindowTextW

while this will fix the assertion failure. As to the reason for the difference, it could be:

  • it is spelled as Notepad.exe under system32 on that particular machine or generally on that version of windows?

  • the underlying Win32 API, NtQuerySystemInformation's documentation seem to provide no version-to-version compatibility guarantees:

    NtQuerySystemInformation may be altered or unavailable in future versions of Windows. Applications should use the alternate functions listed in this topic.

    Issue 55685 processname optimisation #59672 is changing ProcessName to use QueryFullProcessImageName which may (or may not) return the lower case on Windows 11. If someone with rights can run outerloop pipeline on that PR, we will find out.

  • something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Diagnostics.Process needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration
Projects
None yet
Development

No branches or pull requests

3 participants