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

View File

@@ -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(

View File

@@ -3,6 +3,7 @@ import { AppRuntime } from "../../src/effect/app-runtime"
import { Bus } from "../../src/bus"
import { Effect } from "effect"
import { Instance } from "../../src/project/instance"
import { WithInstance } from "../../src/project/with-instance"
import { Pty } from "../../src/pty"
import type { PtyID } from "../../src/pty/schema"
import { tmpdir } from "../fixture/fixture"
@@ -27,7 +28,7 @@ describe("pty", () => {
await using dir = await tmpdir({ git: true })
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(
@@ -68,7 +69,7 @@ describe("pty", () => {
await using dir = await tmpdir({ git: true })
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(

View File

@@ -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 { Shell } from "../../src/shell/shell"
import { tmpdir } from "../fixture/fixture"
@@ -17,7 +18,7 @@ describe("pty shell args", () => {
"does not add login args to pwsh",
async () => {
await using dir = await tmpdir()
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(
@@ -47,7 +48,7 @@ describe("pty shell args", () => {
"adds login args to bash",
async () => {
await using dir = await tmpdir()
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(
@@ -78,7 +79,7 @@ describe("pty configured shell", () => {
await using dir = await tmpdir({
config: { shell: Shell.name(configured) },
})
await Instance.provide({
await WithInstance.provide({
directory: dir.path,
fn: () =>
AppRuntime.runPromise(