Skip to content

Add coverage for executor timeouts, env snapshot, and cleanup retention#58

Merged
seanwevans merged 1 commit into
mainfrom
claude/test-coverage-hardening
Jun 27, 2026
Merged

Add coverage for executor timeouts, env snapshot, and cleanup retention#58
seanwevans merged 1 commit into
mainfrom
claude/test-coverage-hardening

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

Summary

Adds tests for executor and cleanup behavior that previously had no coverage.
Follow-up to #57 (now merged), which wired the Postgres service into CI so the
database-backed test here actually runs instead of skipping.

New / strengthened tests

  • Command timeout enforcement (run_subprocess) — SPEC §7 requires timeouts
    to be enforced, but nothing tested it. New test runs sleep 5 with a 1s
    COMMAND_TIMEOUT and asserts the process is killed and reported as exit code
    124 with a Timed out after 1s message.
  • Env snapshot propagation (run_subprocess) — asserts a variable from the
    command's env_snapshot reaches the child process.
  • Missing binary handling (handle_command) — asserts a non-existent command
    is recorded as failed / exit 1 rather than crashing the worker loop.
  • Cleanup retention (cleanup_once) — asserts only old + completed (done)
    commands are deleted, while recent commands and old non-completed history are
    preserved.
  • fork_session — strengthened the existing test to assert the environment
    env snapshot is copied, not just the working directory.

Verification

  • Against a live Postgres 16: 39 passed (was 35).
  • Without a database: 28 passed, 11 skipped — the three new subprocess-level
    executor tests run without a DB; the new cleanup test skips gracefully.

🤖 Generated with Claude Code


Generated by Claude Code

Closes gaps in the test suite around behavior that previously had no
coverage:

- run_subprocess timeout enforcement (SPEC section 7): a command that
  outruns COMMAND_TIMEOUT is killed and reported as exit code 124.
- run_subprocess applies the env snapshot to the child process.
- handle_command marks a command failed (exit 1) when the binary does
  not exist, instead of crashing the worker.
- cleanup_once deletes only old, completed ('done') commands while
  preserving recent commands and old non-completed history.

Also strengthen the fork_session test to assert the environment snapshot
is copied, not just the working directory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BixPb34oe2Ae5cXuz9WxbP
@seanwevans
seanwevans merged commit 3914cdd into main Jun 27, 2026
2 checks passed
@seanwevans
seanwevans deleted the claude/test-coverage-hardening branch June 27, 2026 00:38
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.

2 participants