tests: verify the process that survives each launcher cleanup mutation #2214

Merged
RavenCurseBurg merged 1 commit from upstream-pr/2222 into main 2026-11-25 05:57:37 +00:00
RavenCurseBurg commented 2026-11-25 05:52:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T05:52:23Z.


The startup launcher fixture reported success for the no-cleanup mutation on both Windows PowerShell 5.1 and PowerShell 7 even though its PID check never ran. At b0669e06 the surviving watcher kept the captured output pipe open. Each run hit the 120-second subprocess timeout, and the mutation loop accepted that unrelated failure. I found this while following the timing of the Windows check in #2217.

Capture the launcher's stdout and stderr in the fixture's temporary directory so the test can inspect the watcher as soon as PowerShell exits. Run both cleanup mutations with -Translate and require the diagnostic for the specific process that survived. The unmodified launcher still runs all seven argument, output and exit-code cases under each shell.

Local Windows measurement No cleanup Stop parent only
Windows PowerShell 5.1, before Timeout, 120.59 s Surviving worker detected
PowerShell 7, before Timeout, 120.72 s Surviving worker detected
Windows PowerShell 5.1, after Surviving watcher detected, 2.56 s Surviving worker detected, 2.63 s
PowerShell 7, after Surviving watcher detected, 2.93 s Surviving worker detected, 2.77 s
  • python -B tests/startup_run_ps1_check.py passed both shells in 35.06 seconds on local Windows. python -B tests/startup_run_ps1_check.py --text-only and git diff --check passed.
  • As a negative control, I made the two cleanup mutants return only a timeout diagnostic. The base suite reported zero failures. The patched suite rejected all four combinations of shell and mutant.
  • The Windows 2025 run on this commit passed both shells under a real 8.3 temporary path. The same workflow step, including the six call-evidence tests, took 18 s here and 269 s on the base run, one measurement per commit.

AI-assisted with Codex (GPT-6.2 Astra xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6598180661 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2222). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T05:52:23Z. --- The startup launcher fixture reported success for the no-cleanup mutation on both Windows PowerShell 5.1 and PowerShell 7 even though its PID check never ran. At `b0669e06` the surviving watcher kept the captured output pipe open. Each run hit the 120-second subprocess timeout, and the mutation loop accepted that unrelated failure. I found this while following the timing of the Windows check in #2217. Capture the launcher's stdout and stderr in the fixture's temporary directory so the test can inspect the watcher as soon as PowerShell exits. Run both cleanup mutations with `-Translate` and require the diagnostic for the specific process that survived. The unmodified launcher still runs all seven argument, output and exit-code cases under each shell. | Local Windows measurement | No cleanup | Stop parent only | | --- | --- | --- | | Windows PowerShell 5.1, before | Timeout, 120.59 s | Surviving worker detected | | PowerShell 7, before | Timeout, 120.72 s | Surviving worker detected | | Windows PowerShell 5.1, after | Surviving watcher detected, 2.56 s | Surviving worker detected, 2.63 s | | PowerShell 7, after | Surviving watcher detected, 2.93 s | Surviving worker detected, 2.77 s | - `python -B tests/startup_run_ps1_check.py` passed both shells in 35.06 seconds on local Windows. `python -B tests/startup_run_ps1_check.py --text-only` and `git diff --check` passed. - As a negative control, I made the two cleanup mutants return only a timeout diagnostic. The base suite reported zero failures. The patched suite rejected all four combinations of shell and mutant. - The [Windows 2025 run on this commit](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45556497160) passed both shells under a real 8.3 temporary path. The same workflow step, including the six call-evidence tests, took 18 s here and 269 s on the [base run](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45554469156), one measurement per commit. AI-assisted with Codex (GPT-6.2 Astra xhigh).
upstream-sync closed this pull request 2026-11-25 06:01:33 +00:00
tedin7 commented 2026-11-25 06:01:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:56:57Z.

Review: COMMENTED


Review of head bacd386ff5 (tests/startup_run_ps1_check.py only).

Findings: 0 P1, 0 P2.

  • Output is captured to temp files, so a surviving watcher cannot hold a pipe open and hide a leak. The watcher PID check now runs right after the shell exits.
  • run_problems with no shell falls back to the text checks. The per-shell loop is simpler and keeps the same behavior.
  • The two live-process cases (translator, translator's child) now assert the exact "still running" message, so each mutant must be killed for the right reason.
  • Only a test file changes. No product code, so no clean-room concern.

Commands run locally:

  • python3 tests/startup_run_ps1_check.py: 0 failed (text-only mode on Linux, no PowerShell).
  • python3 tests/docs_links_check.py: pass.
  • python3 tests/bidi_controls_check.py: pass.
  • git diff --check origin/main...HEAD: clean.
  • Mutation: changed the no-shell fallback in run_problems to return []. The check failed with "mutant 'no capture and no exit' was not detected" (and 3 more). Reverted.

CI: Build and test on Windows = SUCCESS, which runs the executed PowerShell path. The Linux check also passes.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052551622 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2222#pullrequestreview-6052551622). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:56:57Z. **Review:** COMMENTED --- Review of head bacd386ff5eb54c6660bea497bb166b684af2aa1 (tests/startup_run_ps1_check.py only). Findings: 0 P1, 0 P2. - Output is captured to temp files, so a surviving watcher cannot hold a pipe open and hide a leak. The watcher PID check now runs right after the shell exits. - `run_problems` with no shell falls back to the text checks. The per-shell loop is simpler and keeps the same behavior. - The two live-process cases (translator, translator's child) now assert the exact "still running" message, so each mutant must be killed for the right reason. - Only a test file changes. No product code, so no clean-room concern. Commands run locally: - `python3 tests/startup_run_ps1_check.py`: 0 failed (text-only mode on Linux, no PowerShell). - `python3 tests/docs_links_check.py`: pass. - `python3 tests/bidi_controls_check.py`: pass. - `git diff --check origin/main...HEAD`: clean. - Mutation: changed the no-shell fallback in `run_problems` to `return []`. The check failed with "mutant 'no capture and no exit' was not detected" (and 3 more). Reverted. CI: `Build and test on Windows` = SUCCESS, which runs the executed PowerShell path. The Linux check also passes. AI-assisted; commands listed were executed locally.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2214
No description provided.