test(orchestrator): align integration fixtures
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
f609654f11
commit
389879cd81
2 files changed
+45
-2
No files matched your search
@@ -19,6 +19,11 @@ import {
|
||||
ThreadId,
|
||||
type OrchestrationV2ProviderThread,
|
||||
} from "@t3tools/contracts";
|
||||
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
|
||||
import * as DateTime from "effect/DateTime";
|
||||
import * as Crypto from "effect/Crypto";
|
||||
import * as Deferred from "effect/Deferred";
|
||||
import type * as Duration from "effect/Duration";
|
||||
import * as Cause from "effect/Cause";
|
||||
import * as Clock from "effect/Clock";
|
||||
import * as Crypto from "effect/Crypto";
|
||||
@@ -444,6 +449,7 @@ function makeTurnInput(input: {
|
||||
describe("AcpAdapterV2", () => {
|
||||
it.live("cleans detached fixtures when an assertion aborts the test scope", () =>
|
||||
Effect.gen(function* () {
|
||||
if ((yield* HostProcessPlatform) !== "linux") return;
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
let published: ReadonlyArray<number> = [];
|
||||
const failed = yield* Effect.scoped(
|
||||
@@ -648,6 +654,7 @@ describe("AcpAdapterV2", () => {
|
||||
|
||||
it.live("reaps detached native work when the provider exits before explicit teardown", () =>
|
||||
Effect.gen(function* () {
|
||||
if ((yield* HostProcessPlatform) !== "linux") return;
|
||||
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const idAllocator = yield* IdAllocatorV2;
|
||||
@@ -730,6 +737,7 @@ describe("AcpAdapterV2", () => {
|
||||
|
||||
it.live("surfaces reduced guarantee when delegated cgroup containment is unavailable", () =>
|
||||
Effect.gen(function* () {
|
||||
if ((yield* HostProcessPlatform) !== "linux") return;
|
||||
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const idAllocator = yield* IdAllocatorV2;
|
||||
@@ -7066,7 +7074,7 @@ describe("AcpAdapterV2", () => {
|
||||
|
||||
it.live("direct Stop skips uninterruptible ACP cancel and recovers after native teardown", () =>
|
||||
Effect.gen(function* () {
|
||||
if (process.platform !== "linux") return;
|
||||
if ((yield* HostProcessPlatform) !== "linux") return;
|
||||
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const idAllocator = yield* IdAllocatorV2;
|
||||
@@ -7504,7 +7512,7 @@ describe("AcpAdapterV2", () => {
|
||||
|
||||
it.live("restart_active terminates native work and reloads a clean runtime", () =>
|
||||
Effect.gen(function* () {
|
||||
if (process.platform !== "linux") return;
|
||||
if ((yield* HostProcessPlatform) !== "linux") return;
|
||||
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const idAllocator = yield* IdAllocatorV2;
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
type OrchestrationV2ThreadProjection,
|
||||
} from "@t3tools/contracts";
|
||||
import * as Deferred from "effect/Deferred";
|
||||
import * as DateTime from "effect/DateTime";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
@@ -190,4 +191,38 @@ describe("ProviderContinuationService", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it.effect("clears a sticky continuation offer when its thread is archived", () => {
|
||||
return Effect.gen(function* () {
|
||||
const dispatched = yield* Queue.unbounded<unknown>();
|
||||
const cleared = yield* Ref.make(false);
|
||||
yield* Effect.gen(function* () {
|
||||
const requests = yield* ProviderContinuationRequests;
|
||||
yield* requests.offer({
|
||||
...request(),
|
||||
clearIfCurrent: () => Ref.set(cleared, true),
|
||||
});
|
||||
for (let attempt = 0; attempt < 20 && !(yield* Ref.get(cleared)); attempt += 1) {
|
||||
yield* Effect.yieldNow;
|
||||
}
|
||||
assert.isTrue(yield* Ref.get(cleared));
|
||||
assert.isTrue(Option.isNone(yield* Queue.poll(dispatched)));
|
||||
}).pipe(
|
||||
Effect.provide(
|
||||
testLayer({
|
||||
dispatched,
|
||||
getThreadProjection: () =>
|
||||
Effect.succeed({
|
||||
...projection,
|
||||
thread: {
|
||||
...projection.thread,
|
||||
archivedAt: DateTime.makeUnsafe("2026-07-20T00:00:00.000Z"),
|
||||
},
|
||||
}),
|
||||
}),
|
||||
),
|
||||
Effect.scoped,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user