Skip to content

test: expand ProcessTest to cover full process lifecycle (closes #348)#538

Merged
s2x merged 1 commit into
masterfrom
feat/issue-348-process-lifecycle-coverage
Jul 1, 2026
Merged

test: expand ProcessTest to cover full process lifecycle (closes #348)#538
s2x merged 1 commit into
masterfrom
feat/issue-348-process-lifecycle-coverage

Conversation

@s2x

@s2x s2x commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes #348

Changes

  • Add ProcessEventRecorder test listener that writes marker files on ProcessStartEvent and ProcessErrorEvent dispatch
  • Add TestErrorProcess that throws RuntimeException to exercise the error path
  • Add ProcessMarkerPaths constants class as shared source of truth for marker file paths between recorder and test
  • Expand ProcessTest from a single PID-file recency check to full lifecycle coverage:
    • testProcessIsLive — status file recency (regression for restart cycle)
    • testProcessStartEventIsDispatched — start event regression check
    • testNoProcessErrorEventDuringNormalOperation — negative assertion
    • testProcessErrorEventIsDispatchedOnThrowable — error event regression
    • testProcessSurvivesSigtermAndIsRestartedBySupervisor — signal handling (locates worker PID via /proc on Linux or ps on macOS)
  • Update bootstrap.php to clean up marker files on stop
  • Update CHANGELOG.md under [Unreleased] Tests section

Changelog

Process lifecycle test expansion documented under [Unreleased] → Tests.

Code Review

  • Passed subagent code review
  • All review comments addressed (added error-exit test, signal-handling test, shared marker paths, setUp cleanup, explicit listener priority, \x1f delimiter, cross-platform PID lookup)

- Add ProcessEventRecorder test listener that writes marker files on
  ProcessStartEvent and ProcessErrorEvent dispatch
- Add TestErrorProcess that throws RuntimeException to exercise the
  error path
- Add ProcessMarkerPaths constants class as shared source of truth
  for marker file paths between recorder and test
- Expand ProcessTest from a single PID-file recency check to:
  * testProcessIsLive — status file recency (regression for restart cycle)
  * testProcessStartEventIsDispatched — start event regression check
  * testNoProcessErrorEventDuringNormalOperation — negative assertion
  * testProcessErrorEventIsDispatchedOnThrowable — error event regression
  * testProcessSurvivesSigtermAndIsRestartedBySupervisor — signal handling
- Update bootstrap.php to clean up marker files on stop
- Update CHANGELOG.md under [Unreleased] Tests section
@s2x s2x self-assigned this Jul 1, 2026
@s2x
s2x merged commit b2304fd into master Jul 1, 2026
12 checks passed
@s2x
s2x deleted the feat/issue-348-process-lifecycle-coverage branch July 1, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tests] ProcessTest only checks PID-file recency

1 participant