Skip to content

tests/test_lane_helpers.sh:385 — fake pgrep/ps only simulate clean absence, never a genuine process-table read failure, so the PR's fail-closed branches are untested (#61 round, suppressed) #112

Closed
opensoft/openRepoTools-code
#25

Description

@brettheap

Lane: openRepoTools-3 (openRepoTools-3)

Copilot's review of PR #61 (opensoft/openRepoTools#61, commit 2eecf29) suppressed this finding rather than posting it as an inline thread. Filed rather than dropped, under the 2026-09-16 ruling that Copilot is capped at two rounds per PR and #61 is already well past that — this is filed and claimed instead of taken in-PR.

Finding (Copilot, suppressed comment on tests/test_lane_helpers.sh:385)

The new fail-closed process-table branches are not exercised by this fixture: the fake pgrep only returns success or the normal no-match status 1, and the fake ps only returns success or an empty no-match failure. There is no regression for pgrep -f/pgrep -P returning an actual error, or for ps failing with output—the statuses the implementation treats differently from an exited process—so the advertised process-table failure coverage can pass while those safety paths regress.

Fakes quoted by Copilot, tests/test_lane_helpers.sh around line 385:

cat > "$SANDBOX/fakebin/pgrep" <<'FAKE'
#!/usr/bin/env bash
case "${1-}" in
  -f)
    out="$(printf '%s\n' "${FAKE_PGREP_F_PIDS:-}" | awk 'NF')"
    [ -n "$out" ] || exit 1
    printf '%s\n' "$out" ;;
  -P)
    out="$(printf '%s\n' "${FAKE_PGREP_CHILDREN:-}" | awk -F'\t' -v pp="${2-}" '$2 == pp { print $1 }')"
    [ -n "$out" ] || exit 1
    printf '%s\n' "$out" ;;
  *) exit 1 ;;
esac
FAKE

cat > "$SANDBOX/fakebin/ps" <<'FAKE'
#!/usr/bin/env bash
target=""
while [ $# -gt 0 ]; do
  case "$1" in
    -p) target="${2-}"; shift 2 ;;
    *)  shift ;;
  esac
done
[ -n "$target" ] || exit 1
line="$(printf '%s\n' "${FAKE_PS_RECORDS:-}" | awk -F'\t' -v p="$target" '$1 == p { print; exit }')"
[ -n "$line" ] || exit 1
printf '%s\n' "$line" | awk -F'\t' '{printf "%s %s %s\n", $1, $2, $3}'

What to do

Both fakes only ever exit 1 for "no match" (an exited/absent process) — the same status a genuine read failure would also produce in some real implementations, but not the one this PR's fail-closed logic is written to distinguish. Add a mode to each fake (an env var toggle, matching this suite's existing style) that exits with a different, error-shaped status the fixture never claims is "clean absence" — e.g. a pgrep/ps that errors out (bad invocation, permission failure) rather than just finding nothing — and add cases asserting the PR's new fail-closed branches actually refuse on that status rather than only on the ordinary no-match path. Without this, the process-table failure coverage this PR advertises can regress silently.

Activity

  1. brettheap commented on Sep 16, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-16T13:04:39Z, for #112

    Logged in lanes/log/openRepoTools-3.md at 550bbade1ded57f668a05326468ee46d3847d043.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#112:
       none
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#112"`, kept where the row or its body names `#112`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `112` as a whole token:
       none
    
  2. brettheap commented on Nov 10, 2026

    @brettheap
    ContributorAuthor

    RELEASED — lane openRepoTools-3, session 83619980-06bb-4469-ae73-2a8c5e61981a@Eagle, 2026-11-10T13:29:38Z, for #112 — closed by opensoft/openRepoTools-code#25 (squash ecd1bce)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions