Skip to content

test(regression): failing tests for the two live P1s — comsub on non-UTF-8 files (#772) and the unbounded-producer hang (#761) - #777

Merged
caomengxuan666 merged 1 commit into
masterfrom
test/p1-regressions
Oct 18, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
test/p1-regressions

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

What this is

Failing Rust regression tests for the two P1 defects from this audit that are still live on master, in the shape this repository already uses (tests/issueNNN_*.rs, env!("CARGO_BIN_EXE_rubash"), expectations quoted from GNU bash 5.3.0):

file issue what it pins
tests/issue772_comsub_non_utf8_file_regressions.rs #772 $(cat FILE) on non-UTF-8 content: empty (or truncated) substitution plus a bogus No such file or directory
tests/issue761_pipeline_unbounded_producer_regressions.rs #761 an unbounded external producer into a shell-side tail never returns (yes | true); RSS grows ~250 MB/s

Why they are #[ignore]d, and why that is the point

A reproduction that is red on master cannot be merged un-ignored without turning CI red for everyone. So each reproduction carries #[ignore = "rubash#NNN: diverges on master …; un-ignore with the fix"]:

  • CI stays green today — verified: 2 passed; 0 failed; 4 ignored and 3 passed; 0 failed; 2 ignored;
  • the fix un-ignores one line and the case is armed as a regression guard from then on;
  • running them deliberately shows the divergence rather than an aspiration:
$ cargo test --test issue772_comsub_non_utf8_file_regressions -- --ignored
test command_substitution_of_non_utf8_file_is_not_empty ... FAILED
  left: "0"   right: "1"     stderr="cat: 'f': No such file or directory\n"
test command_substitution_with_two_operands_keeps_every_byte ... FAILED
  left: "3"   right: "4"     stderr="cat: 'f': No such file or directory\n"

If you would rather not add #[ignore] attributes (I noticed a slice policy against new ones), tell me the mechanism you prefer — an env-gated opt-in in the style of RUBASH_REQUIRE_BASHDB_FIXTURE=1, or a separate target — and I will convert it.

Controls are part of the file, on purpose

Each file carries tests that pass today, because a green reproduction is otherwise indistinguishable from a broken fixture:

The hang tests are bounded, and the tree is killed

A hang test that is not bounded turns a red CI into a stuck CI, and a red run that does not kill the tree leaves a yes behind for the next test. So run_bounded waits at most BOUND = 10 s, then taskkill /F /T on the shell's pid and fails with the bound it hit. Verified: the four --ignored reproductions finish in 41 s (i.e. four bounds, no infinite run), and no rubash.exe/yes.exe of mine is left behind — the two rubash.exe processes I did find in tasklist belong to another worktree (D:\repo\rubash-wt-726\target\debug\rubash.exe trap-signal-matrix.sh) and were left alone.

Notes

  • cargo fmt --check is clean; the tests are Windows-gated (#![cfg(windows)]) like the neighbouring regression files, and both use env_remove("BASH_ENV") / env_remove("WINUXSH_ROOT") to avoid the inherited-environment traps documented in AGENTS.md.
  • Scope is deliberately two files for two issues: I can split into two PRs if one-concern-per-PR is preferred here.
  • These two issues are also pinned in the differential catalogue of test(regression): per-issue differential catalogue with a stale-build gate (#746) #774; the difference is that this PR is the form that runs in your CI.

Refs #761, #772.

…UTF-8 files (#772) and the unbounded-producer hang (#761)

Reproductions carry #[ignore = "rubash#NNN: diverges on master …; un-ignore
with the fix"] so CI stays green while the defect is real; each file also
carries controls that pass today, so a green reproduction cannot be mistaken
for a broken fixture.  The hang tests are bounded and kill their process tree
on expiry: an unbounded hang test turns a red CI into a stuck CI.
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