Skip to content

test: harden process_unix_test.go ps-availability skips and a vacuous assertion #863

Description

@PierrunoYT

Context

Follow-up from review of PR #774.

internal/execution/process_unix_test.go has robustness gaps that could let regressions in ps-based zombie detection go unnoticed:

  1. Three tests (TestTerminateProcessTreeTreatsZombieGroupAsExited, TestTerminateProcessTreeStopsRunningGroup's setup implicitly, TestSignalTargetRunningTreatsZombieIndividualPIDAsExited) use t.Skip when ps is unavailable or the process doesn't reach the zombie state in time. ps is present on CI images today, so this doesn't bite currently, but the tests can go quietly green (as skips) if ps parsing or availability ever regresses in CI.

  2. TestTerminateProcessTreeStopsRunningGroup's final assertion:

    if running, ok := processGroupHasRunningMember(pid); ok && running {
        t.Fatal("the group still has a running member after termination")
    }

    passes vacuously when ok is false (i.e., when ps state couldn't be determined at all) — the same "silently degrades" failure mode as the skips above.

Proposed fix

  • Consider failing loudly (rather than skipping) when ps is expected to be available (e.g., detect a hard CI environment variable, or simply let these fail instead of skip so a broken ps pipeline surfaces immediately instead of showing as skipped-green).
  • Change TestTerminateProcessTreeStopsRunningGroup's final assertion to t.Fatal on !ok too, so an undetectable state is treated as a failure rather than silently passing.

Not blocking; ps is available on all CI images used today.

Activity

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

    issue-approvedReviewed and approved by the core team; community PRs may implement this issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions