Skip to content

Add deterministic process-signal lifecycle support to Repl.Testing #82

Description

@autocarl

Context

PR #80 adds process-wide first/second-signal coordination. Unit tests can exercise internal coordination seams, while real SIGINT/SIGTERM behavior currently requires spawning a child process and sending an operating-system signal. Consumers building on Repl.Testing need a supported, repeatable way to verify cleanup and exit-code contracts.

Desired outcome

Provide either:

  1. a public in-memory test abstraction that can drive the logical process-signal lifecycle without real global OS registrations; or
  2. first-class documented helpers for child-process signal tests when in-memory simulation would give false confidence.

A hybrid is likely appropriate: deterministic in-memory tests for policy/coordination and process tests for runtime/platform integration.

Acceptance criteria

  • Tests can model first-signal cooperative cancellation and second-signal escalation deterministically.
  • Tests can assert cleanup completion, callback failures, explicit exit-code precedence, and late joiners.
  • The helper does not mutate real process-global signal state unless explicitly requested.
  • Real-process guidance covers PID lifetime, output draining, timeouts, forced cleanup, and Unix/Windows differences.
  • Repl.Testing documentation states which guarantees require a spawned process.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions