Skip to content

WIP: test(2270): foreign-observer harness repair for numbered-fd heredoc pins - #2283

Merged
caomengxuan666 merged 3 commits into
masterfrom
test/2270-pin-harness-repair
Oct 30, 2026
Merged

caomengxuan666 merged 3 commits into
masterfrom
test/2270-pin-harness-repair

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Tests-only harness repair for the #2270 regression pins. No product code changes.

Problem

tests/issue2270_external_numbered_fd_heredoc_regressions.rs observed spawn-delivered fds through ./reader3.sh / ./reader4.sh / ./reader0.sh — ENOEXEC shell scripts that rubash executes via its in-process script-child face, where spawn-delivered fd bindings never appear. On master (c17160e) the target read 2 passed / 8 failed, deterministically: the script child reported 3: Bad file descriptor and printed fd3-closed for every numbered-fd shape — including the plain 3<file control. The product face itself was verified correct with foreign ELF observers (python3 reading fd 3 receives the heredoc body and the file body byte-identical to GNU bash 5.3.20).

Change

Every pin's observing child is now the nested rubash binary re-invoked as a real spawned process — the pattern the #2272 pins use — whose read loop makes the exact same observations the reader scripts made (per-line echo, fd-open check at EOF, exit code). Redirect shapes, expected bodies, and exit-code expectations are unchanged; the observer mechanism is the only change. This includes the two pins that were passing (issue2270_no_delimiter_file_created, issue2270_fd0_heredoc_control_still_works): both also observed through a script child, so both were repaired for uniformity. Test names carry the issue number and expectations remain the GNU ones, per the regression rule.

Verification (local, collector exception for this target)

  • Baseline on c17160e before the repair: 2 passed / 8 failed.
  • After the repair, same tree: 10 passed / 0 failed (cargo test --test issue2270_external_numbered_fd_heredoc_regressions).
  • git diff touches only tests/issue2270_external_numbered_fd_heredoc_regressions.rs; per-file rustfmt applied; CR count 0.

Refs #2270

The pins observed spawn-delivered fds through ./readerN.sh ENOEXEC scripts, which rubash runs in-process; the delivered bindings never appear there, so 8 of 10 pins read fd3-closed on a correct tree. Re-observe through the nested rubash binary (the pattern the #2272 pins use). Assertions, redirect shapes, and expectations unchanged.

Refs #2270
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 30, 2026 21:09
@caomengxuan666
caomengxuan666 merged commit a9d59c6 into master Oct 30, 2026
11 checks passed
@caomengxuan666
caomengxuan666 deleted the test/2270-pin-harness-repair branch November 2, 2026 01:11
SpookyWaste pushed a commit to SpookyWaste/rubash that referenced this pull request Nov 12, 2026
…ubash spawn

Refs unixwin#2286

The control pin for the numbered `3<>` face observed spawn fd
delivery through `./child.sh`, an ENOEXEC script child that rubash
runs in-process, where spawn-delivered bindings do not appear the
same way — its green could not by itself prove the spawn delivery
face it guards (the same harness defect PR unixwin#2283 repaired for the
unixwin#2270 pins).

The observing child is now the nested rubash binary re-invoked as a
real spawned process (`"<RUBASH>" -c 'echo via3 >&3' 3<>num.txt`),
making the exact same observation: write `via3` to fd 3, exit 0.
The redirect shape and both expectations are unchanged. Tests
only; no product code touched.

Local verification: `cargo check --test
issue2261_child_script_readwrite_fd0_regressions` clean. The pin
target itself was not run locally (compile rationing) — it is
pending the collector's scrubbed-fd batch.
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