claude-print/tests
jedarden e97a8413b5 feat(bf-2f5): watchdog timeout implementation complete
Implement comprehensive watchdog timeout mechanism to prevent indefinite hangs
when child process wedges. All four timeout types are now enforced:

Timeout Types:
- PTY first-output timeout (default 90s): Detects if child produces no PTY output
- Stream-json first-output timeout (default 90s): Detects if child emits no stream-json events
- Overall timeout (default 3600s): Maximum session duration
- Stop hook timeout (default 120s): Detects if Stop hook doesn't fire after prompt injection

Timeout Behavior:
- Sends SIGTERM to child process
- Signals event loop via self-pipe to wake up
- Calls kill_child() which waits 2s then SIGKILL if needed
- Writes clear diagnostic to stderr
- Tears down temp resources via CleanupGuard
- Exits with code 124 (GNU timeout convention)

CLI Arguments:
- --timeout <seconds>: Overall timeout
- --first-output-timeout <seconds>: PTY first-output timeout
- --stream-json-timeout <seconds>: Stream-json first-output timeout
- --stop-hook-timeout <seconds>: Stop hook watchdog timeout

Testing:
- All 90 unit tests pass (6 watchdog-specific tests)
- Integration tests verify end-to-end timeout behavior

This ensures marathon loop/NEEDLE can retry cleanly instead of hanging indefinitely.
2026-06-25 13:39:29 -04:00
..
fixtures Add Phase 9: NEEDLE integration — install.sh, claude-print.yaml, --check subcommand 2026-06-10 01:36:28 -04:00
integration Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
cli.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
emitter.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
hooks.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
integration.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
pty_integration.rs Implement Phase 6: Stop Poller (bf-64s) 2026-06-10 00:05:14 -04:00
startup.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
stop_poller.rs Implement Phase 6: Stop Poller (bf-64s) 2026-06-10 00:05:14 -04:00
terminal.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
transcript.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
version_compat.rs Add bf-5nr validation notes: claude-print-ci WorkflowTemplate YAML is valid 2026-06-10 02:11:37 -04:00
watchdog.rs feat(bf-2f5): watchdog timeout implementation complete 2026-06-25 13:39:29 -04:00