Skip to content

Prove a .NET Framework run by the code the program wrote - #423

Closed
MelbourneDeveloper wants to merge 1 commit into
mainfrom
chore/netfx-run-exit-flake
Closed

MelbourneDeveloper wants to merge 1 commit into
mainfrom
chore/netfx-run-exit-flake

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR

Fixes the flaky Windows netfx-language leg: a .NET Framework run that returned 50 was reported by VS Code as exit 0.

Details

  • Cause: VS Code's terminal process fires exitCode || 0. On Windows, node-pty can close conout before ConPTY hands over the exit code, so onDidEndTaskProcess reports 0. It happened in "a project built for .NET Framework ALONE still RUNS" (netfx-run-fsharp.test.ts) on a loaded runner. The run took 7 s, as long as a real run, so it was the run's own exit and not another task's.
  • Fix: each fixture console program (writeConsole in netfx-msbuild-kit.ts) also writes its exit code to exit-code.txt beside its binary. assertRanWith asserts:
    • that file holds the exact code (48 on .NET Framework or 10 on .NET, plus the argument count);
    • exactly one task process ended;
    • its reported code is that code, or the pty's lost 0. These programs never return 0.
  • runFrom deletes the result file before each run, so a stale file cannot pass.
  • Only test files change.

How Do The Automated Tests Prove It Works?

  • netfx-run-fsharp.test.ts covers all three Run cases through runFrom: RunProbe on net48 (48), RunProbe on the newest .NET (10), and NetfxOnly on net462 with its profile arguments (50).
  • The program written by writeConsole builds for net48 and net10.0. On net10.0, run with alpha beta, it exits 12 and writes 12.
  • tsc, eslint and prettier are clean.

…e code the pty reported

VS Code's terminal process fires exitCode || 0, and on Windows node-pty can
close conout before ConPTY hands over the exit code, so a run that returned 50
was reported as 0. Each fixture program now writes its code beside its binary;
the test asserts that code exactly, and that the one task exit is that code or
the pty's lost 0, which these programs never return.
@MelbourneDeveloper
MelbourneDeveloper enabled auto-merge (squash) October 21, 2026 06:23
auto-merge was automatically disabled October 21, 2026 06:24

Pull request was closed

@MelbourneDeveloper
MelbourneDeveloper deleted the chore/netfx-run-exit-flake branch October 26, 2026 19:38
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.

1 participant