Skip to content

Stabilize pipe process stdin round-trip test#14013

Merged
aibrahim-oai merged 3 commits intomainfrom
dev/pty-pipe-stdin-flake
Mar 11, 2026
Merged

Stabilize pipe process stdin round-trip test#14013
aibrahim-oai merged 3 commits intomainfrom
dev/pty-pipe-stdin-flake

Conversation

@aibrahim-oai
Copy link
Collaborator

@aibrahim-oai aibrahim-oai commented Mar 9, 2026

What changed

  • keep the explicit stdin-close behavior after writing so the child still receives EOF deterministically
  • on Windows, stop using python -c for the round-trip assertion and instead run a native cmd.exe pipeline that reads one line from stdin with set /p and echoes it back
  • send on Windows so the stdin payload matches the platform-native line ending the shell reader expects

Why this fixes flakiness

The failing branch-local flake was not in spawn_pipe_process itself. The child exited cleanly, but the Windows ARM runner sometimes produced an empty stdout string when the test used Python as the stdin consumer. That makes the test sensitive to Python startup and stdin-close timing rather than the pipe primitive we actually want to validate. Switching the Windows path to a native cmd.exe reader keeps the assertion focused on our pipe behavior: bytes written to stdin should come back on stdout before EOF closes the process. The explicit write removes line-ending ambiguity on Windows.

Scope

  • test-only
  • no production logic change

@aibrahim-oai aibrahim-oai requested a review from jif-oai March 9, 2026 00:10
@aibrahim-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff8179109e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

} else {
shell_command(&split_stdout_stderr_command())
};
let (program, args) = shell_command(&split_stdout_stderr_command());
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Badge Disable cmd AutoRun when asserting exact split output

This test now routes Windows through shell_command, which invokes cmd.exe /C without /D. cmd can execute AutoRun scripts, which may emit extra stdout/stderr and break the exact assert_eq! checks for split-out/split-err, creating environment-dependent flakes. The prior Windows path avoided cmd entirely.

Useful? React with 👍 / 👎.

@aibrahim-oai aibrahim-oai merged commit f6e966e into main Mar 11, 2026
31 checks passed
@aibrahim-oai aibrahim-oai deleted the dev/pty-pipe-stdin-flake branch March 11, 2026 00:00
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant