os-sdlc test suite leaves ruby-lsp daemons running after full-suite runs #651

Closed
opened 2026-09-23 18:21:42 +00:00 by jared · 1 comment
Owner

lsp-probe test daemon leaks when an in-test assertion fails

Problem

After full os-sdlc suite runs on 2026-09-23, ruby-lsp processes stayed alive with test-tmp-dir cwds, adding load; narrower than first filed. Only plugins/os-sdlc/tests/lsp_probe_bin_test.rb spawns a real daemon; its with_daemon helper calls assert_stopped after yield with no ensure, so a failing assertion inside the block leaks the daemon.

Cases

  1. Given a test using with_daemon whose block assertion fails, when the test run completes, then no daemon process for that test's root remains.
  2. Given a test using with_daemon whose block passes, when the test run completes, then the daemon is stopped as before.

Approach

Wrap the yield so stop runs in an ensure block inside with_daemon.

Required work:

  1. Change with_daemon in plugins/os-sdlc/tests/lsp_probe_bin_test.rb to run stop/assert_stopped in an ensure around the yield
  2. Verify by a test or manual run with a forced failure that no daemon survives — check: pgrep -f ruby-lsp after a deliberately failing with_daemon block

Acceptance criteria

  1. Given a with_daemon block whose assertion raises, when the test process exits, then no ruby-lsp process with that test's root remains.

Owner sketch

def with_daemon(root)
  yield
ensure
  stop
end

Origin

  • Trigger: #643 merge verification, 2026-09-23
  • Chain: test isolation defect ← #648 (timing flake under load)
  • Where: plugins/os-sdlc/tests/lsp_probe_bin_test.rb
  • Session: 073fd763-259f-4218-95e6-e8449caae354
# lsp-probe test daemon leaks when an in-test assertion fails ## Problem After full os-sdlc suite runs on 2026-09-23, ruby-lsp processes stayed alive with test-tmp-dir cwds, adding load; narrower than first filed. Only plugins/os-sdlc/tests/lsp_probe_bin_test.rb spawns a real daemon; its `with_daemon` helper calls `assert_stopped` after `yield` with no `ensure`, so a failing assertion inside the block leaks the daemon. ## Cases 1. Given a test using `with_daemon` whose block assertion fails, when the test run completes, then no daemon process for that test's root remains. 2. Given a test using `with_daemon` whose block passes, when the test run completes, then the daemon is stopped as before. ## Approach Wrap the yield so stop runs in an ensure block inside `with_daemon`. Required work: 1. Change `with_daemon` in plugins/os-sdlc/tests/lsp_probe_bin_test.rb to run `stop`/`assert_stopped` in an `ensure` around the yield 2. Verify by a test or manual run with a forced failure that no daemon survives — check: `pgrep -f ruby-lsp` after a deliberately failing `with_daemon` block ## Acceptance criteria 1. Given a `with_daemon` block whose assertion raises, when the test process exits, then no ruby-lsp process with that test's root remains. ## Owner sketch ```ruby def with_daemon(root) yield ensure stop end ``` ## Origin - Trigger: #643 merge verification, 2026-09-23 - Chain: test isolation defect ← #648 (timing flake under load) - Where: plugins/os-sdlc/tests/lsp_probe_bin_test.rb - Session: 073fd763-259f-4218-95e6-e8449caae354
Author
Owner

Resolution

Done: Full-suite runs no longer leak ruby-lsp daemons: real-server integration tests run only under PROCMAN_REAL=1 and call Procman.stop_all in Minitest.after_run; procman servers self-exit when leases drop (ADR-0219, #712).

Evidence: Commit cd265726 on branch ticket-712; after a full suite run pgrep -f 'lsp-probe serve' matched no server process.

Follow-ups: #714 adds procman cleanup to the SessionStart hook.

## Resolution **Done:** Full-suite runs no longer leak ruby-lsp daemons: real-server integration tests run only under PROCMAN_REAL=1 and call Procman.stop_all in Minitest.after_run; procman servers self-exit when leases drop (ADR-0219, #712). **Evidence:** Commit cd265726 on branch ticket-712; after a full suite run `pgrep -f 'lsp-probe serve'` matched no server process. **Follow-ups:** #714 adds procman cleanup to the SessionStart hook.
jared closed this issue 2026-09-25 16:57:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#651
No description provided.