test(server): make Windows path and async fixtures deterministic (#9576)
Co-authored-by: Claude Code <[email protected]>
This commit is contained in:
1 parent
5f4c7161fa
commit
b123cbb317
9 files changed
+125
-75
No files matched your search
@@ -60,7 +60,16 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
|
||||
yield* fs.writeFileString(filePath, `${encoded}\n`);
|
||||
return yield* Effect.acquireRelease(
|
||||
Effect.sync(() => NodeFS.openSync(filePath, "r")),
|
||||
(fd) => Effect.sync(() => NodeFS.closeSync(fd)),
|
||||
// Without a /proc or /dev/fd path to reopen, the reader consumes the fd
|
||||
// itself (autoClose), so on Windows it is already closed here.
|
||||
(fd) =>
|
||||
Effect.sync(() => {
|
||||
try {
|
||||
NodeFS.closeSync(fd);
|
||||
} catch (error) {
|
||||
if ((error as NodeJS.ErrnoException).code !== "EBADF") throw error;
|
||||
}
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -281,13 +290,15 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
|
||||
|
||||
it.effect("uses bootstrap envelope values as fallbacks when flags and env are absent", () =>
|
||||
Effect.gen(function* () {
|
||||
const { join } = yield* Path.Path;
|
||||
const baseDir = "/tmp/t3-bootstrap-home";
|
||||
const { join, resolve } = yield* Path.Path;
|
||||
// The resolver absolutises the configured home, so the expectation must
|
||||
// carry the host's drive on Windows.
|
||||
const baseDir = resolve("/tmp/t3-bootstrap-home");
|
||||
const fd = yield* openBootstrapFd(
|
||||
makeDesktopBootstrap({
|
||||
port: 4888,
|
||||
host: "127.0.0.2",
|
||||
t3Home: baseDir,
|
||||
t3Home: "/tmp/t3-bootstrap-home",
|
||||
noBrowser: true,
|
||||
desktopBootstrapToken: "desktop-token",
|
||||
desktopTelemetryFd: 4,
|
||||
|
||||
Reference in new issue
Block a user