Skip to content

Fix flaky TestWindowStyle: check only STARTF_USESHOWWINDOW bit, remove ShellExecute cases - #125847

Merged
adamsitnik merged 2 commits into
mainfrom
copilot/fix-processstartinfo-tests
Mar 21, 2026
Merged

Fix flaky TestWindowStyle: check only STARTF_USESHOWWINDOW bit, remove ShellExecute cases#125847
adamsitnik merged 2 commits into
mainfrom
copilot/fix-processstartinfo-tests

Conversation

CopilotAI commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Description

ProcessStartInfoTests.TestWindowStyle was flaky in CI due to two issues:

  1. Exact dwFlags assertion — the test compared the full dwFlags value, but the OS can set additional bits beyond STARTF_USESHOWWINDOW (0x1), causing spurious failures.
  2. ShellExecute test cases — half the test matrix (useShellExecute: true) tested OS ShellExecute implementation behavior, which is not our responsibility to verify and was the primary source of timeouts.

Changes

  • Check only the STARTF_USESHOWWINDOW bit (si.dwFlags & 0x1) instead of the exact dwFlags value
  • Remove useShellExecute parameter and all [InlineData(..., true/false)] entries (8 → 4 test cases)
  • Remove Mono ShellExecute skip logic (SkipTestException) and unused using Microsoft.DotNet.XUnitExtensions
- Assert.Equal(expectedDwFlag, si.dwFlags);+ Assert.Equal(expectUsesShowWindow, (si.dwFlags & 0x1) != 0); // STARTF_USESHOWWINDOW is 0x1
Original prompt

This section details on the original issue you should resolve

<issue_title>System.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle failing in CI</issue_title>
<issue_description>## Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1144025
Build error leg or test failing: System.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle
Pull request: #119528

Error Message

Fill the error message using step by step known issues guidance.

{
"ErrorMessage": ["System.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle", "Assert.True() Failure", "Expected: True"],
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎https://dev.azure.com/dnceng-public/public/_build/results?buildId=1144025
Error message validated:[System.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle Assert.True() Failure Expected: True]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/10/2025 12:16:36 PM UTC

Report

BuildDefinitionTestPull Request
1344644dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle#124544
1344588dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle#125821
1344101dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle
1342209dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle#125758
1341738dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle#124770
1341721dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle#125742
1341628dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle
1340451dotnet/runtimeSystem.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle#125706
1338820dotnet/runtimeSystem.Diagnostics.Process.Tests.WorkItemExecution#125643
1338310dotnet/runtime[System.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle](https://dev.azure.com/dnceng-public/public/_build/resu...

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

…TARTF_USESHOWWINDOW bit
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix System.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle failure in CIFix flaky TestWindowStyle: check only STARTF_USESHOWWINDOW bit, remove ShellExecute casesMar 20, 2026
CopilotAI requested a review from adamsitnikMarch 20, 2026 17:38
@adamsitnik
adamsitnik marked this pull request as ready for review March 20, 2026 17:59
CopilotAI review requested due to automatic review settings March 20, 2026 18:00

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes ProcessStartInfoTests.TestWindowStyle on Windows by narrowing the assertion to the STARTF_USESHOWWINDOW bit and removing UseShellExecute-driven cases that exercised OS ShellExecute behavior (and caused CI timeouts).

Changes:

  • Update the test to assert only whether STARTF_USESHOWWINDOW is set (dwFlags & 0x1) rather than comparing the entire dwFlags value.
  • Remove the useShellExecute dimension from the theory data (8 cases → 4 cases).
  • Remove Mono-specific ShellExecute skip logic and the now-unused Microsoft.DotNet.XUnitExtensions using.

@adamsitnik
adamsitnik enabled auto-merge (squash) March 20, 2026 19:14
@adamsitnik

Copy link
Copy Markdown
Member

/ba-g wasm timeout is unrelated

@adamsitnik
adamsitnik merged commit 814f1ae into mainMar 21, 2026
88 of 90 checks passed
@adamsitnik
adamsitnik deleted the copilot/fix-processstartinfo-tests branch March 21, 2026 08:04
@adamsitnikadamsitnik added this to the 11.0.0 milestone Mar 21, 2026
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Apr 20, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Diagnostics.Tests.ProcessStartInfoTests.TestWindowStyle failing in CI

4 participants

@adamsitnik@danmoseley