verify: the privileged row's skip flag leaks into its own self-test, so verify fast always fails it #386

Open
opened 2026-11-06 03:20:20 +00:00 by kayg · 0 comments
Owner

Found by J175 while gating mesh-ssh-p3-j175 at 60d5f09a8 (on origin/dev 2eb38a21d). Its scripts/ are identical to origin/dev. This isn't mesh SSH work, so it gets its own issue here.

What happens. scripts/verify fast fails privileged integration with FAIL (1), at its own self-test, before any privileged area runs:

FAIL: test_gate_prints_skip_for_77 (__main__.PrivilegedAreas.test_gate_prints_skip_for_77)
Only an opted-in row records 77 as SKIP; an ordinary row records FAIL (77) (J270 P3-2).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/claude/worktrees/j175/scripts/test-verify-privileged.py", line 110, in test_gate_prints_skip_for_77
    self.assertIn('plain|FAIL (77)', out)
AssertionError: 'plain|FAIL (77)' not found in '\n==> skipped\n(skipped: 0s)\n\n==> ok\n(ok: 0s)\nfailed=0\n\n==> plain\n(plain: 0s)\nfailed=0\nskipped|SKIP\nok|PASS\nplain|SKIP\n'
----------------------------------------------------------------------
Ran 51 tests in 6.746s

FAILED (failures=1)

Cause. rust_run_gate_skippable is RUST_GATE_SKIPPABLE=yes rust_run_gate "$@" (scripts/verify.d/rust.sh:34-36). bash exports a prefix assignment on a function call to every child the function starts. The privileged row runs verify_privileged under it, and verify_privileged first runs python3 scripts/test-verify-privileged.py. That test's bash -c therefore inherits RUST_GATE_SKIPPABLE=yes, so its ordinary plain row records SKIP. The self-test fails only inside the row it guards:

$ python3 -I scripts/test-verify-privileged.py PrivilegedAreas.test_gate_prints_skip_for_77
OK
$ RUST_GATE_SKIPPABLE=yes python3 -I scripts/test-verify-privileged.py PrivilegedAreas.test_gate_prints_skip_for_77
FAILED (failures=1)

Effects.

  1. Every verify fast on dev since 4ed525485 should fail this row.
  2. Because verify_privileged does python3 scripts/test-verify-privileged.py || return, the privileged areas themselves never run in fast.
  3. Any other child of a skippable row inherits the flag in the same way, so a nested gate's 77 would also read as SKIP.

Possible fixes (not chosen here): set the flag as a local inside a wrapper and unset it for the command (local RUST_GATE_SKIPPABLE=yes with the command run through env -u RUST_GATE_SKIPPABLE), or pass "skippable" as an argument instead of an environment variable. The self-test could also clear the variable for its bash -c, but that alone would hide the leak from other children.

Found by J175 while gating `mesh-ssh-p3-j175` at `60d5f09a8` (on origin/dev `2eb38a21d`). Its `scripts/` are identical to origin/dev. This isn't mesh SSH work, so it gets its own issue here. **What happens.** `scripts/verify fast` fails `privileged integration` with `FAIL (1)`, at its own self-test, before any privileged area runs: ``` FAIL: test_gate_prints_skip_for_77 (__main__.PrivilegedAreas.test_gate_prints_skip_for_77) Only an opted-in row records 77 as SKIP; an ordinary row records FAIL (77) (J270 P3-2). ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/claude/worktrees/j175/scripts/test-verify-privileged.py", line 110, in test_gate_prints_skip_for_77 self.assertIn('plain|FAIL (77)', out) AssertionError: 'plain|FAIL (77)' not found in '\n==> skipped\n(skipped: 0s)\n\n==> ok\n(ok: 0s)\nfailed=0\n\n==> plain\n(plain: 0s)\nfailed=0\nskipped|SKIP\nok|PASS\nplain|SKIP\n' ---------------------------------------------------------------------- Ran 51 tests in 6.746s FAILED (failures=1) ``` **Cause.** `rust_run_gate_skippable` is `RUST_GATE_SKIPPABLE=yes rust_run_gate "$@"` (`scripts/verify.d/rust.sh:34-36`). bash exports a prefix assignment on a function call to every child the function starts. The privileged row runs `verify_privileged` under it, and `verify_privileged` first runs `python3 scripts/test-verify-privileged.py`. That test's `bash -c` therefore inherits `RUST_GATE_SKIPPABLE=yes`, so its ordinary `plain` row records `SKIP`. The self-test fails only inside the row it guards: ``` $ python3 -I scripts/test-verify-privileged.py PrivilegedAreas.test_gate_prints_skip_for_77 OK $ RUST_GATE_SKIPPABLE=yes python3 -I scripts/test-verify-privileged.py PrivilegedAreas.test_gate_prints_skip_for_77 FAILED (failures=1) ``` **Effects.** 1. Every `verify fast` on dev since `4ed525485` should fail this row. 2. Because `verify_privileged` does `python3 scripts/test-verify-privileged.py || return`, the privileged areas themselves never run in `fast`. 3. Any other child of a skippable row inherits the flag in the same way, so a nested gate's 77 would also read as SKIP. **Possible fixes** (not chosen here): set the flag as a `local` inside a wrapper and `unset` it for the command (`local RUST_GATE_SKIPPABLE=yes` with the command run through `env -u RUST_GATE_SKIPPABLE`), or pass "skippable" as an argument instead of an environment variable. The self-test could also clear the variable for its `bash -c`, but that alone would hide the leak from other children.
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#386
No description provided.