Skip to content

[test][platform:linux] 24 cli_tests red on Android unmasked by #613 (fail-fast hid them behind the lib failures): 13 missing bashdb fixture, 6 Windows-hardcoded expectations, 3 host-tool assumptions, 2 to triage #615

Closed

Description

@caomengxuan666

Result summary

After #613 made --lib green (578/578 on this device), cargo's fail-fast no longer stops at the lib target — the sanctioned loop cargo test --workspace --locked now proceeds into --test cli_tests and surfaces a previously hidden stratum: 444 passed / 24 failed / 3 ignored (28 s) on Android/Termux aarch64. The loop still exits red, so #610's stated goal ("a Unix-clean baseline for the sanctioned fast loop") is not yet reached — but none of the 24 were introduced by this week's PRs:

checkout --test cli_tests result
e785c3c (pre-batch) 434 passed / 33 failed
334afab (master, #611-613) 444 passed / 24 failed

The 24 are a strict subset of the pre-existing 33 (the batch actually fixed 9 examples:: tests). Also verified: failures are identical with and without INPUTRC=/dev/null (not the #610 inputrc leak), and deterministic across reruns.

Triage of all 24 by root cause:

A. bashdb fixture not bootstrapped — 13 (all of bashdb_compat)

Every test in this module shells out to target/bashdb-clean/bashdb-generated, which does not exist in a fresh checkout: it can only be produced by scripts/setup-bashdb-fixture.sh <path-to-bashdb-checkout>, and this host has no bashdb. Manual repro:

$ printf 'help\nquit\n' | ./target/debug/rubash target/bashdb-clean/bashdb-generated --no-highlight target/bashdb-probe-target.sh
bashdb-generated: No such file or directory
rc=127

11 fail on assert!(output.status.success()); 2 more in the same file (compound_assignment_splits_unquoted_associative_array_element, getopts_long_preserves_quoted_positional_arguments_through_eval) also call ensure_bashdb_probe_fixture() but fail on assertion diffs — those two need a second look to tell fixture-dependency from genuine divergence.

Suggested fix (same pattern as #613's /-listing skip): runtime-skip when the fixture is absent (or auto-bootstrap it in the Once setup), so a host without a bashdb checkout gets ignored, not failed. As it stands, anyone cloning on Unix and running the sanctioned loop gets 13 reds that are pure environment.

B. Tests hardcoding Windows-environment outcomes — 6

  • uname_builtin_yields_to_shell_function_but_command_bypasses — expects Msys; on this device rubash -c 'command uname -o' prints android, and GNU bash prints Android. (Side observation: rubash's builtin says android, the platform's real uname -o says Android — a cosmetic case divergence worth its own note, but the test failure itself is the hardcoded Msys.)
  • tilde_user_expands_passwd_home_via_rubash_root, tilde_user_assignment_value_expands_and_missing_stays_literal, tilde_user_colon_terminated_word_glues_verbatim — expect /c/Users/niu-home… fixture homes; here the fixture passwd entry isn't visible so ~niu stays literal.
  • login_flag_does_not_change_windows_startup_behavior — expects profile NOT sourced (body); on this host a profile gets sourced (PROFILE-SOURCED\nbody), i.e. the test encodes Windows startup semantics.
  • c_external_command_reads_eof_from_null_device_alias — expects cat < nUl → status:0 (Windows case-insensitive NUL alias). On Unix rubash matches GNU bash exactly (nUl: No such file or directory, rc=1) — see manual repro below. The assertion is stricter than GNU here; it should be platform-conditional (status:0 on Windows, GNU-parity status:1 elsewhere), or assert rubash == bash on the host.
$ ./target/debug/rubash -c 'cat < nUl; echo rc=$?'   →  rc=1   (bash: line 1: nUl: No such file or directory)
$ bash           -c 'cat < nUl; echo rc=$?'          →  rc=1   (same)

C. Host-tool / platform-gated expectations — 3

  • script_file_accepts_crlf_control_flow, source_file_accepts_crlf_control_flow — expect CRLF scripts to parse; on Android both rubash and GNU bash reject them with the same syntax error: unexpected end of file from 'if' (manual repro, both rc=2). So either CRLF tolerance is a Windows-only feature (then the tests need a platform gate) or it's supposed to work everywhere (then the parser path is broken off-Windows — worth a product-side look).
  • compat_issue_regressions::cp_dot_slash_source_copies_contents_into_existing_directory — expects GNU coreutils message Not a directory; Android's cp is toybox, which says No such file or directory for the same case. Expected-output fixture assumes GNU userland.

D. Genuine behavior-diff candidates — 2 (need product-side triage)

  • invalid_cli_shopt_option_fails_before_command_string — stderr lacks invalid option name.
  • c_command_external_uses_persistent_fd_copied_from_stdin — non-zero exit; cause not yet isolated.

These two may be real Unix/Android behavior gaps rather than test assumptions — worth running first when someone picks this up.

Incidental observations

  • process_substitution::coproc_input_move_marks_array_endpoint_closed failed once in a full parallel run but passes 3/3 in isolation — a timing-sensitive flake, not in the 24.
  • Wrong-invariant framing (per AGENTS.md): the suite's baseline was authored on Windows, so "expected output" fixtures silently encode the dev host for families A-C. The fix is test-side (skip/fixture/platform-conditional expectations), mirroring what test: isolate platform-dependent tests for #610 #613 did for INPUTRC and /.

Repro

cargo test --workspace --locked              # fail-fast: dies at --test cli_tests, 24 red
cargo test --test cli_tests --locked         # full 24-name list
cargo test --test cli_tests --locked bashdb  # family A in 1 s
git worktree add $PREFIX/tmp/rubash_e785 e785c3c8f610 && cd $_ && cargo test --test cli_tests --locked   # pre-batch: 33 red (superset)

Activity

  1. added
    bug
    platform:linux
    P2-medium
    on Oct 15, 2026
  2. caomengxuan666 commented on Oct 15, 2026

    @caomengxuan666
    MemberAuthor

    Review follow-up (uncommitted fix/issue-615 worktree, baseline 334afab2):

    Bounded fresh-build slices: Linux 51 passed / 1 failed / 2 existing ignored;
    Windows (clean environment) 55 / 1 / 2. Passed totals each include eleven
    optional external-fixture early returns and are not bashdb coverage. The sole
    remaining named failure is #621. Adjacent Linux fd slice passes 20/20 serially;
    the initial parallel attempt exposed existing shared-helper-dir races. Ownership
    map validation remains blocked by baseline's missing src/input/readline/;
    not rewritten here. No Android execution or full-suite claim.

    GNU 5.3 script-file probes and raw logs are in
    target/issue-suites/results/issue-615/; durable interpretation is in
    docs/issue-suite-diff-analysis.md. No self-commit; captain reviews/stages.
    #615 remains open, not claimed resolved.

  3. caomengxuan666 commented on Oct 15, 2026

    @caomengxuan666
    MemberAuthor

    Ledger extension: --test executor_tests is a second pre-existing red stratum (1229 red)

    While gating PR #624 I ran cargo test --test executor_tests on this host and found a stratum larger than the cli_tests 24 and not yet in the ledger:

    checkout --test executor_tests result
    334afab (master) 321 passed / 1229 failed / 36 ignored (~10 s)
    #624 head (78667e2) 321 passed / 1229 failed / 36 ignored

    Sorted failure-name sets are byte-identical between the two checkouts (single-line diff is a line-mangling artifact of the run, not a test difference) — so this is 100% pre-existing and #624 introduces zero new reds here.

    Characteristics observed:

    • Cascade, not 1229 independent bugs: everything before serial position ~372 passes; the first red block is command_chaining::part_010 heredoc tests; from there almost everything after fails. Spot-checked victims (part_080::test_named_coproc_executes_time_prefixed_brace_body, part_010::test_sequential_commands_keep_heredoc_body_order) pass in isolation on the same tree — a poison-state effect at/before the part_009→part_010 boundary, not genuine assertion divergence.
    • Serial (--test-threads=1) and parallel runs produce the same counts → not thread-scheduling flake; deterministic across reruns.
    • This binary currently sits outside the sanctioned loop's visible range the same way cli_tests did before test: isolate platform-dependent tests for #610 #613 (workspace run stops at cli_tests' 24 first).

    Suggested triage (mirrors family A/B/C style): find the first poisoner (bisect by running part_001..part_010 ranges serially), then either fix the leaked state test-side or gate the binary on it — after which executor_tests could become part of the #610 "clean baseline" goal instead of an invisible 1229-red wall.

  4. caomengxuan666 commented on Oct 16, 2026

    @caomengxuan666
    MemberAuthor

    All 24 now green: verified cli_tests serial 465/0/3-ignored at b1eff54. Fixed by #625 (fixture/platform gates) + #660 (#621 transport prefix). Parallel-only fd_redirects race split to #667.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2-mediumbugplatform:linux

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions