Skip to content

test(runtime): close shell-run stores before cleanup - #3644

Merged
Astro-Han merged 1 commit into
apache:mainfrom
kyletser:fix/runtime-shell-store-cleanup
Aug 24, 2026
Merged

test(runtime): close shell-run stores before cleanup#3644
Astro-Han merged 1 commit into
apache:mainfrom
kyletser:fix/runtime-shell-store-cleanup

Conversation

@kyletser

Copy link
Copy Markdown
Contributor

Summary

Track every SQLite ShellRun store opened by the shell-run-manager suite and close those leases before removing the temporary workspaces. This removes the deterministic Windows EBUSY cleanup failure without retrying or masking deletion while a live owner remains.

Refs #2624

Verification

  • npm --workspace @maka/runtime run typecheck — passed.
  • npm --workspace @maka/runtime run build — passed.
  • Windows PowerShell UTF-8 gate from windows-baseline.yml — 2 passed, 0 failed, and exited normally.
  • Mutation check: temporarily removed the store close() loop; both selected assertions still passed, then the top-level hook failed with EBUSY ... runtime.sqlite and exit code 1. Restoring the loop returned the gate to exit code 0.
  • npm run lint and npm run format:check — passed.
  • npx knip --workspace apps/desktop and npx knip --workspace packages/ui — passed (desktop reported two existing configuration hints).
  • Full shell-run-manager file on Windows — 42 passed, 9 failed, 8 skipped. The remaining failures are the other Windows PTY behavior slices already described in ci(windows): eliminate hidden failures in the non-blocking baseline #2624; the runtime.sqlite cleanup hook failure is absent.
  • Root npm run build / npm run typecheck reach Desktop and then fail on the three pre-existing SessionChangedEvent.type errors in goal-services-adapter.test.ts. Current main fails at the same Build step: https://github.com/apache/maka/actions/runs/32652983938

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex diagnosed the ownership boundary, implemented the test-lifecycle change, ran the verification and mutation checks, and drafted this pull request description. The commit includes the required Generated-by: Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

The affected Runtime checks, lint, format, and selected Windows gate pass; the unchecked item reflects the current unrelated Desktop build/typecheck baseline failure documented above.

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Copilot AI lite review requested due to automatic review settings August 23, 2026 17:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kyletser
kyletser force-pushed the fix/runtime-shell-store-cleanup branch from 70e123d to a8661ab Compare August 23, 2026 18:00
@kyletser

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto current main at a8661ab, which includes #3642 and removes the three pre-existing SessionChangedEvent.type build errors from the initial run. The new workflow run is currently action_required, so it needs maintainer approval before CI can execute. The branch still contains only the original targeted runtime test cleanup commit.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at exact head a8661abd. No findings — no [P0]–[P3]. Publishing on behalf of a reviewer without write access here; I re-verified the scope and gate state before posting.

The diff is confined to the runtime shell-run test lifecycle. The wrapper tracks every ClosableShellRunStore it creates, and the top-level after closes each store before removing the directory — which is the right order, and the whole point of the change. Nothing in the production path moves.

Independent validation at this head: focused build plus the shell-run-manager suite at 58 passed / 4 skipped / 0 failed, with lint, format, and git diff --check all clean.

Not approving yet, and the reason is procedural rather than substantive. When this was reviewed the exact-head checks had never executed — the run was parked at action_required, which is the state fork PRs sit in until someone releases them. I have since released it and test is now running. Never-run is not the same as green, so the approval has to wait for a terminal result on this exact head. Assuming it lands green and the head does not move, this is ready.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate now satisfied at the same head a8661abd. The run I released has landed: test is terminal completed/success, which is the only check this path set triggers. The head has not moved since the review above, there are no unresolved threads, and no [P0]–[P3] were found.

Approving.

@Astro-Han
Astro-Han merged commit 0dd9197 into apache:main Aug 24, 2026
1 check passed
@Astro-Han

Copy link
Copy Markdown
Contributor

LGTM — merged. Thanks for the contribution!

中文

已合并,感谢贡献。

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.

3 participants