Skip to content

test(core): use disposable session fixtures - #45745

Merged
kitlangton merged 3 commits into
v2from
disposable-session-tests
Aug 28, 2026
Merged

test(core): use disposable session fixtures#45745
kitlangton merged 3 commits into
v2from
disposable-session-tests

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

Three Session test boundaries manually reproduce the async-disposal protocol already implemented by Effect.acquireDisposable. The prompt image case additionally bypasses the shared temporary-directory fixture, losing its canonical path and busy-directory cleanup behavior.

What Changes

  • Use Effect.acquireDisposable for the two session-create acquisitions and the replay acquisition in session-message-update.
  • Build the prompt image fixture with the existing fixture/tmpdir helper instead of direct mkdtemp/rm.
  • Keep every existing test scope, callback lifetime, target layer, assertion, and fixture cleanup error visible.

Scope

This completes the still-unowned TESTS-03 occurrences. #45637 owns the same cleanup in move, remove, revert, and view tests, with no file overlap. #45680 touches the active-session assertion in session-prompt.test.ts, not this image fixture.

Open same-file PRs have no behavioral dependency: #45735 adds a session-create case that calls the existing withTmp boundary; #45336 adds a later session-message-update case; neither changes these acquisitions. #45575 changes other prompt fixtures and its import hunk adds new mkdtemp users, so whichever PR lands second must reconcile that import block while preserving both independent fixture changes.

Verification

# packages/core
bun run test test/session-create.test.ts test/session-message-update.test.ts test/session-prompt.test.ts
bun typecheck

# repository root
bunx prettier --check packages/core/test/session-create.test.ts packages/core/test/session-message-update.test.ts packages/core/test/session-prompt.test.ts
bunx oxlint packages/core/test/session-create.test.ts packages/core/test/session-message-update.test.ts packages/core/test/session-prompt.test.ts
bunx ast-grep scan -c script/ast-grep/effect-simplifications/sgconfig.yml --off=unused-suppression packages/core/test/session-create.test.ts packages/core/test/session-message-update.test.ts packages/core/test/session-prompt.test.ts
git diff --check
git push -u origin disposable-session-tests

The focused suites passed 90 tests with 271 assertions. Core typecheck, structural scan, whitespace checks, and the normal pre-push 33-package workspace typecheck passed. Oxlint reported no errors and six existing warnings. Prettier accepts every changed line but its full-file check still flags an unrelated pre-existing multiline expression in session-prompt.test.ts; that formatter-only change was deliberately excluded from this PR.

@kitlangton
kitlangton merged commit 0b32bdf into v2 Aug 28, 2026
8 checks passed
@kitlangton
kitlangton deleted the disposable-session-tests branch August 28, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant