Skip to content

test(cli): stop the viewer when a test fails - #304

Merged
sunerpy merged 1 commit into
mainfrom
test/cli-ui-viewer-drop
Oct 3, 2026
Merged

sunerpy merged 1 commit into
mainfrom
test/cli-ui-viewer-drop

Conversation

@sunerpy

@sunerpy sunerpy commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Summary

A failing assertion in a cli_ui test leaves its codegraph ui server running after the test binary exits. The test unwinds past Viewer::stop, and std::process::Child neither kills nor waits when it is dropped. The test's temporary project is deleted on the way out, so the server keeps serving a directory that no longer exists. Three servers from one failed run during #298's development had been running for twelve hours.

Viewer now kills and reaps its child in Drop. stop and the panic in start both go through it, so start no longer kills by hand. Passing tests behave exactly as before.

Verification

A temporary probe test started a viewer and then panicked. It was not committed.

  • On main, one server outlived the failed test (/tmp/evidence-tidy/red-probe.log).
  • With this change, none did (green-probe.log).

Also run:

  • cargo test -p codegraph-rs --test cli_ui: 15 passed, and no codegraph ui process is left afterwards (cli-ui.log);
  • cargo clippy -p codegraph-rs --tests -- -D warnings;
  • cargo fmt --all --check.

🤖 Generated with Claude Code

A failing assertion in a cli_ui test unwound past `Viewer::stop`, and
`std::process::Child` neither kills nor waits when it is dropped, so the
`codegraph ui` server the test started outlived the test binary. Three such
servers had been running for twelve hours. `Viewer` now kills and reaps its
child in `Drop`, which both `stop` and the panic in `start` go through.
@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #304   +/-   ##
=======================================
  Coverage   95.05%   95.05%           
=======================================
  Files         197      197           
  Lines      108387   108387           
=======================================
  Hits       103023   103023           
  Misses       5364     5364           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit f2154e5 into main Oct 3, 2026
11 checks passed
@sunerpy
sunerpy deleted the test/cli-ui-viewer-drop branch October 3, 2026 03:20
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.

1 participant