Skip to content

Commit 85e99f6

Browse files
committed
test(stack): give the real-engine removal wait the container test budget
1 parent 94f0c0f commit 85e99f6

1 file changed

Lines changed: 40 additions & 37 deletions

File tree

‎packages/stack/src/runtime/Container.integration.test.ts‎

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -961,43 +961,46 @@ describe("container process adapter", () => {
961961
}).pipe(Effect.provide(NodeServices.layer)),
962962
);
963963

964-
it.live("waits for a real removal observed as removing", () =>
965-
Effect.gen(function* () {
966-
const delegate = yield* ChildProcessSpawner.ChildProcessSpawner;
967-
const crypto = yield* Crypto.Crypto;
968-
const token = yield* crypto.randomUUIDv4;
969-
const instanceId = `pending-remove-${token}`;
970-
const pendingProbes = yield* Ref.make(2);
971-
const lostResult = yield* Ref.make(false);
972-
const spawner = makePendingRemoveSpawner(delegate, pendingProbes, lostResult);
973-
yield* Effect.ensuring(
974-
Effect.gen(function* () {
975-
const result = yield* Effect.scoped(
976-
Effect.gen(function* () {
977-
const runtime = yield* makeContainerRuntime({ engine: "docker", root: "." });
978-
yield* runtime.prepare(image);
979-
const process = yield* runtime.launch({
980-
image,
981-
stackId: "n".repeat(64),
982-
instanceId,
983-
env: {},
984-
args: ["-e", stoppableIdleScript],
985-
});
986-
yield* process.stop;
987-
yield* process.remove;
988-
}),
989-
).pipe(
990-
Effect.exit,
991-
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
992-
);
993-
expect(yield* Ref.get(lostResult)).toBe(true);
994-
expect(yield* Ref.get(pendingProbes)).toBe(0);
995-
expect(Exit.isSuccess(result)).toBe(true);
996-
expect(yield* idsByInstance(instanceId)).toHaveLength(0);
997-
}),
998-
removeByInstance(instanceId).pipe(Effect.orDie),
999-
);
1000-
}).pipe(Effect.provide(NodeServices.layer)),
964+
it.live(
965+
"waits for a real removal observed as removing",
966+
() =>
967+
Effect.gen(function* () {
968+
const delegate = yield* ChildProcessSpawner.ChildProcessSpawner;
969+
const crypto = yield* Crypto.Crypto;
970+
const token = yield* crypto.randomUUIDv4;
971+
const instanceId = `pending-remove-${token}`;
972+
const pendingProbes = yield* Ref.make(2);
973+
const lostResult = yield* Ref.make(false);
974+
const spawner = makePendingRemoveSpawner(delegate, pendingProbes, lostResult);
975+
yield* Effect.ensuring(
976+
Effect.gen(function* () {
977+
const result = yield* Effect.scoped(
978+
Effect.gen(function* () {
979+
const runtime = yield* makeContainerRuntime({ engine: "docker", root: "." });
980+
yield* runtime.prepare(image);
981+
const process = yield* runtime.launch({
982+
image,
983+
stackId: "n".repeat(64),
984+
instanceId,
985+
env: {},
986+
args: ["-e", stoppableIdleScript],
987+
});
988+
yield* process.stop;
989+
yield* process.remove;
990+
}),
991+
).pipe(
992+
Effect.exit,
993+
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
994+
);
995+
expect(yield* Ref.get(lostResult)).toBe(true);
996+
expect(yield* Ref.get(pendingProbes)).toBe(0);
997+
expect(Exit.isSuccess(result)).toBe(true);
998+
expect(yield* idsByInstance(instanceId)).toHaveLength(0);
999+
}),
1000+
removeByInstance(instanceId).pipe(Effect.orDie),
1001+
);
1002+
}).pipe(Effect.provide(NodeServices.layer)),
1003+
{ timeout: 120_000 },
10011004
);
10021005

10031006
it.live("retains the remove failure when removing never reaches absence", () =>

0 commit comments

Comments
 (0)