Skip to content

test: make E2E resource cleanup await process exit - #884

Merged
V3RON merged 8 commits into
mainfrom
fix/871-e2e-resource-lifecycle
Oct 22, 2026
Merged

V3RON merged 8 commits into
mainfrom
fix/871-e2e-resource-lifecycle

Conversation

@V3RON

@V3RON V3RON commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Console route handlers, pages and CLI children could outlive daemon fixtures; partial startup also lacked cleanup.

Result

Close tracked pages and remove handlers before daemon disposal. Await CLI children, escalate after SIGTERM, and verify daemon PID exit before removing its home. Disposal can recover from graceful-stop delay after PID exit is confirmed; explicit stop() remains strict. PID discovery fails closed. Partial startup is cleaned, and explicit listener-stop coverage keeps its observing page. Related to #871.

Validation

  • Daemon lifecycle and event history E2E: 17 passed before the final fixture-only change.
  • Gateway inbox restart, single-host shutdown and explicit listener-stop: 3 passed.
  • Failed-shard Queue cases: 4 passed; long-install worker tabs: 1 passed after final changes.
  • Pre-commit and pre-push hooks passed.

CI status and dependency

Run 39761388095 failed four Queue cases because children did not exit after SIGTERM, and worker tabs because graceful stop left the socket. Cleanup now escalates and confirms exit. Its search shard also hit the selection race fixed in #882. This PR is based on fix/864-console-semantic-waits; retarget to main after #882 merges. New CI is pending.

Review

Spec review: skipped. Code review: 0 blocking, 2 fixed, 0 notes. Claims review: skipped.
Rounds: 1. Tokens: n/a.

One gpt-6.1-sol verification round, following the user-requested abbreviated workflow. Sol identified PID-discovery ambiguity and cleanup paths that could skip escalation. Both were fixed; daemon exit is verified before home removal. No second review round was performed.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 22, 2026 10:13
@V3RON
V3RON force-pushed the fix/871-e2e-resource-lifecycle branch from 69c3627 to 40c34e3 Compare October 22, 2026 10:34
@V3RON
V3RON changed the base branch from main to fix/864-console-semantic-waits October 22, 2026 10:34
Base automatically changed from fix/864-console-semantic-waits to main October 22, 2026 10:46
@V3RON
V3RON merged commit da6949b into main Oct 22, 2026
50 checks passed
@V3RON
V3RON deleted the fix/871-e2e-resource-lifecycle branch October 22, 2026 10:56
V3RON added a commit that referenced this pull request Oct 22, 2026
#882 and #884 landed on main; main's cleanup in e2e/console/fixtures.ts replaces this branch's
cleanup commits, and the daemon process now has to exit before history.db is edited.
V3RON added a commit that referenced this pull request Oct 22, 2026
## Problem
Overview and Usage presentation tests waited for the next minute
boundary before reading completed stats.

## Result
Prepare completed historical usage rows while the daemon is stopped,
then restart it. Require strict stop, socket removal and process exit
before editing the history database. Keep the UI and CLI assertions
against real daemon output. Console fixture disposal escalates failed
graceful cleanup and verifies exit before home removal.

## Validation
- Overview/Usage Console cases: 12 passed after final changes.
- Long-install worker tabs cleanup: 1 passed.
- Usage projection and stats E2E: 8 passed before the final Console
fixture-only change.
- Pre-commit and pre-push hooks passed.

## CI status and dependency
Run 39761604557 had four Queue child-exit failures and a worker
socket-removal failure; cleanup now escalates and confirms exit. Search
failures were the selection race fixed in #882. This PR is based on
`fix/864-console-semantic-waits`; retarget to `main` after #882 merges.

Its E2E (1/3) also got 409 instead of 201 in the second request of
`gateway-smoke.test.ts`. That test does not use the changed Console
fixture. The focused file passed on base `f5aa210c` (6 tests), so the CI
failure remains unconfirmed. New CI is pending.

## Review

Spec review: skipped. Code review: 0 blocking, 1 fixed, 0 notes. Claims
review: skipped.
Rounds: 1. Tokens: n/a.

One gpt-6.1-sol verification round, following the user-requested
abbreviated workflow. Sol identified missing proof of daemon shutdown
before history edits. Fixed by checking stop success, socket removal and
process exit. No second review round was performed.

## Update after #882 and #884

Merged main. #884's cleanup in `e2e/console/fixtures.ts` replaces this
branch's three cleanup commits (no-owner exit code, stale socket lookup,
forced cleanup), so main's version is kept. `prepareHistoricalUsage` now
also waits for the daemon process to exit, because main's `stop()` waits
only for the socket. Overview and Usage Console specs: 57 passed locally
(all three browsers).

*Written by an agent.*
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