Skip to content

Commit ec24de6

Browse files
test(server): drop bootstrap test cases another case already covers
AI-assisted; verified with the tests and tools listed above.
1 parent 466945c commit ec24de6

2 files changed

Lines changed: 26 additions & 50 deletions

File tree

‎apps/server/src/bootstrap.test.ts‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,24 +156,6 @@ it.layer(NodeServices.layer)("readBootstrapEnvelope", (it) => {
156156
}),
157157
);
158158

159-
it.effect("accepts an envelope arriving after the former one-second deadline", () =>
160-
Effect.gen(function* () {
161-
const { fd, stream, reading } = yield* openControlledBootstrapInput;
162-
const fiber = yield* readBootstrapEnvelope(TestEnvelopeSchema, fd).pipe(
163-
Effect.provideService(HostProcess.Platform, "win32"),
164-
Effect.forkScoped,
165-
);
166-
167-
yield* Deferred.await(reading);
168-
yield* TestClock.adjust(1_001);
169-
stream.end('{"mode":"desktop"}\n');
170-
171-
const payload = yield* Fiber.join(fiber);
172-
assert.deepEqual(payload, { mode: "desktop" });
173-
assert.isTrue(stream.destroyed);
174-
}).pipe(Effect.provide(TestClock.layer())),
175-
);
176-
177159
it.effect("fails at the default deadline and releases the pending reader", () =>
178160
Effect.gen(function* () {
179161
const { fd, stream, reading } = yield* openControlledBootstrapInput;

‎apps/server/src/cli/config.test.ts‎

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -755,41 +755,35 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
755755
lan: Option.none<boolean>(),
756756
});
757757

758-
it.effect.each(["flag", "env"] as const)(
759-
"rejects an unavailable bootstrap fd from %s before creating server state",
760-
(source) =>
761-
Effect.gen(function* () {
762-
const fs = yield* FileSystem.FileSystem;
763-
const path = yield* Path.Path;
764-
const root = yield* fs.makeTempDirectoryScoped({ prefix: "t3-cli-bootstrap-required-" });
765-
const baseDir = path.join(root, "server-home");
766-
const fd = 2_147_483_647;
758+
it.effect("rejects an unavailable bootstrap fd before creating server state", () =>
759+
Effect.gen(function* () {
760+
const fs = yield* FileSystem.FileSystem;
761+
const path = yield* Path.Path;
762+
const root = yield* fs.makeTempDirectoryScoped({ prefix: "t3-cli-bootstrap-required-" });
763+
const baseDir = path.join(root, "server-home");
764+
const fd = 2_147_483_647;
767765

768-
const error = yield* resolveServerConfig(
769-
{
770-
...minimalWebFlags(baseDir),
771-
mode: Option.none(),
772-
bootstrapFd: source === "flag" ? Option.some(fd) : Option.none(),
773-
},
774-
Option.none(),
775-
).pipe(
776-
Effect.provide(
777-
Layer.mergeAll(
778-
NetService.layer,
779-
ConfigProvider.layer(
780-
ConfigProvider.fromEnv({
781-
env: source === "env" ? { T3CODE_BOOTSTRAP_FD: String(fd) } : {},
782-
}),
783-
),
784-
),
766+
const error = yield* resolveServerConfig(
767+
{
768+
...minimalWebFlags(baseDir),
769+
mode: Option.none(),
770+
bootstrapFd: Option.some(fd),
771+
},
772+
Option.none(),
773+
).pipe(
774+
Effect.provide(
775+
Layer.mergeAll(
776+
NetService.layer,
777+
ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })),
785778
),
786-
Effect.flip,
787-
);
779+
),
780+
Effect.flip,
781+
);
788782

789-
assert.instanceOf(error, BootstrapFdStatError);
790-
assert.equal(error.fd, fd);
791-
expect(yield* fs.exists(baseDir)).toBe(false);
792-
}),
783+
assert.instanceOf(error, BootstrapFdStatError);
784+
assert.equal(error.fd, fd);
785+
expect(yield* fs.exists(baseDir)).toBe(false);
786+
}),
793787
);
794788

795789
it.effect("uses the automatic port selector only when no port is configured", () =>

0 commit comments

Comments
 (0)