Normalize instance lifecycle wiring (#25501)

This commit is contained in:
Kit Langton
2026-05-02 20:39:20 -04:00
committed by GitHub
parent a6464062b7
commit 7d91d3b1ed
71 changed files with 852 additions and 936 deletions
@@ -2,6 +2,7 @@ import { describe, expect, test } from "bun:test"
import { AppRuntime } from "../../src/effect/app-runtime"
import { Effect } from "effect"
import { Instance } from "../../src/project/instance"
import { WithInstance } from "../../src/project/with-instance"
import { Pty } from "../../src/pty"
import { tmpdir } from "../fixture/fixture"
import { setTimeout as sleep } from "node:timers/promises"
@@ -10,7 +11,7 @@ describe("pty", () => {
test("does not leak output when websocket objects are reused", async () => {
await using dir = await tmpdir({ git: true })
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(
@@ -60,7 +61,7 @@ describe("pty", () => {
test("does not leak output when Bun recycles websocket objects before re-connect", async () => {
await using dir = await tmpdir({ git: true })
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(
@@ -105,7 +106,7 @@ describe("pty", () => {
test("treats in-place socket data mutation as the same connection", async () => {
await using dir = await tmpdir({ git: true })
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(