Skip to content

Stabilize PLM inherited-output regression test - #1289

Open
Richie Gomez (richiemsft) wants to merge 1 commit into
mainfrom
richiemsft/fix-plm-inherited-output-test
Open

Richie Gomez (richiemsft) wants to merge 1 commit into
mainfrom
richiemsft/fix-plm-inherited-output-test

Conversation

@richiemsft

@richiemsft Richie Gomez (richiemsft) commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Fixes the remaining flakiness in start::tests::inherited_output_handle_cannot_block_control_completion after #848.

The previous fixture used PowerShell to start another PowerShell process, publish its PID through a temporary file, and hold inherited stdout/stderr handles open. Under CI load, the outer PowerShell could reach the 30-second control timeout before publishing the PID, causing cleanup setup to panic before the behavioral assertions ran.

This change replaces the nested PowerShell bootstrap with ignored, nonce-scoped Rust test-process helpers. The parent helper deterministically starts a bounded descendant from the already-built test executable, records its PID before signaling readiness, and exits while the descendant retains the inherited output handles. The descendant remains alive beyond the controller bound, and the existing drop guard terminates its process tree on every exit path.

No production PLM behavior changes.

🔗 References

Resolves #1098

🔍 Validation

  • Focused regression passed 100 consecutive runs on both main and this branch.
  • The intermittent CI failure did not reproduce in either 100-run local sample, so the comparison alone does not statistically demonstrate elimination. The change instead removes the reported PowerShell/PID-publication race structurally.
Version Passed Failed Mean Median P95 Max
main baseline 100 0 6.40 s 6.22 s 7.01 s 19.83 s
This fix 100 0 4.35 s 4.30 s 4.92 s 5.21 s

The fixed fixture reduced mean runtime by approximately 32% and substantially tightened the long tail.

Additional validation:

  • cargo test -p plm: 227 passed, 3 ignored
  • cargo clippy -p plm --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • Confirmed no matching leaked baseline sleeper processes remained
  • Independent code review found no significant issues

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • Updated documentation (not applicable; test-only fix)
  • Updated Copilot instructions (not applicable; no build, architecture, or convention change)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (not applicable; Cargo.lock unchanged)

📋 Issue Type

  • Bug fix
  • Feature
  • Task

GitHub Actions runs the PR validation build automatically. The ADO pipeline
(MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity with the GitHub
Actions build; it runs on merge to main, and Microsoft reviewers with write access can trigger it
on a PR with /azp run. See docs/pull-requests.md.

If the dependency-feed-check check fails on a new dependency, the crate must be added to
the feed before the PR can pass. See docs/pull-requests.md
for the steps.

Microsoft Reviewers: Open in CodeFlow

Fixes #1098

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e408b60b-e267-416c-806d-0a7e119fe53f
Copilot AI balanced review requested due to automatic review settings September 26, 2026 01:03
@richiemsft
Richie Gomez (richiemsft) requested a review from a team as a code owner September 26, 2026 01:03
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The test-only fixture removes the reported race while preserving output-handle behavior and cleanup.

Review effort: Balanced
Findings: None

What changed in this PR

Stabilizes the Windows PLM inherited-output regression test without changing production behavior.

Changes:

  • Replaces nested PowerShell processes with nonce-scoped Rust test helpers.
  • Records the descendant PID before signaling readiness.
  • Retains bounded execution and process-tree cleanup.
File Description
src/​host/​plm/​src/​start.rs Adds deterministic parent and descendant test helpers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@richiemsft

Richie Gomez (richiemsft) commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Gudge (@MGudgin)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky PLM inherited-output test can miss PID file after 30 seconds

2 participants