GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(core): use effectful temp fixtures by kitlangton · Pull Request #45637 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Why

Effect-based session tests adapted an async-disposable temporary-directory fixture through Effect.promise and repeated acquisition wrappers. That duplicated lifecycle wiring at each call site and obscured the fixture policy that canonicalizes paths and retries transient Windows cleanup failures.

What Changes

The shared fixture now exposes a scoped Effect resource directly:

const tmp = yield* tmpdirScoped()

Six acquisitions across Session move, remove, revert, and view tests use that API without manual release callbacks or disposable adaptation. tmpdirScoped() owns acquisition and release with Effect.acquireRelease; the async tmpdir() API and withTempDir share the same make and remove implementation.

Windows Path Contract

The OS boundary deliberately remains on fs/promises. Under Bun on Windows, the callback APIs used by Effect FileSystem returned short RUNNER~1 paths instead of the canonical runneradmin path and could hang during recursive removal. The promise APIs preserve the existing canonical-path contract and the established 30-attempt EBUSY cleanup policy with garbage collection and a 100 ms delay.

Scope

This is test infrastructure only. It preserves the temporary-directory prefix, canonical paths, cleanup policy, and async API; other Promise-based fixture call sites remain available for incremental migration.

Verification

cd packages/core
bun run test
bun run test test/session-move.test.ts test/session-remove.test.ts test/session-revert.test.ts test/session-view.test.ts test/tool-edit.test.ts test/tool-write.test.ts
bun typecheck

cd ../..
bunx prettier --check packages/core/test/fixture/tmpdir.ts packages/core/test/session-move.test.ts packages/core/test/session-remove.test.ts packages/core/test/session-revert.test.ts packages/core/test/session-view.test.ts
bunx oxlint packages/core/test/fixture/tmpdir.ts
git diff --check
git push origin disposable-fixtures

The full Core run passed 3,815 tests and the focused run passed 35 tests. Core typecheck, formatting, fixture lint, diff validation, and the full 33-package push-hook typecheck passed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kitlangton
test(core): use disposable session fixtures
5ca5049
@github-actions github-actions Bot added the contributor label Aug 27, 2026
@kitlangton kitlangton mentioned this pull request Aug 27, 2026
test(core): use disposable session fixtures #45745
Merged
@kitlangton
Merge remote-tracking branch 'origin/v2' into disposable-fixtures
cb6b081
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
#
# Conflicts:
#	packages/core/test/session-revert.test.ts
@kitlangton kitlangton changed the title test(core): use disposable session fixtures test(core): use effectful temp fixtures Aug 28, 2026
kitlangton added 3 commits August 27, 2026 23:59
@kitlangton
Merge remote-tracking branch 'origin/v2' into disposable-fixtures
c177529
# ------------------------ >8 ------------------------
# Do not modify or remove the line above.
# Everything below it will be ignored.
#
# Conflicts:
#	packages/core/test/fixture/tmpdir.ts
@kitlangton
test(core): avoid hanging temp cleanup
a5f57d7
@kitlangton
test(core): preserve canonical temp paths
049ac7d
@kitlangton
kitlangton merged commit 5743537 into v2 Aug 28, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kitlangton
kitlangton deleted the disposable-fixtures branch August 28, 2026 05:01
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
@kitlangton
test(core): use effectful temp fixtures (anomalyco#45637)
524646a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kitlangton
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.