Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions tests/boundary/sqlite/sqliteDatabaseDescriptorCleanup.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Cli } from "incur";
import { access, writeFile } from "node:fs/promises";
import type { FileHandle } from "node:fs/promises";
import { join } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { expect, it, onTestFinished, vi } from "vitest";

Expand Down Expand Up @@ -274,7 +274,7 @@ it("retains reply-read cancellation and retries the failed reply descriptor clos
{ signal: controller.signal },
);
if (result.ok) throw new Error("Expected cancelled reply read");
expect(projectAnalysisError(result.error)).toMatchObject({
const cancelled = {
code: "cleanup_incomplete",
details: {
execution_failure: "cancelled",
Expand All @@ -285,7 +285,20 @@ it("retains reply-read cancellation and retries the failed reply descriptor clos
truncated: false,
},
},
});
};
// Windows cannot remove the private root while the reply descriptor is open,
// so root cleanup also fails and retains the cancellation as its previous error.
expect(projectAnalysisError(result.error)).toMatchObject(
process.platform === "win32"
? {
code: "cleanup_incomplete",
details: {
resources: [dirname(descriptorCleanup.path)],
diagnostics: { previous_error: cancelled },
},
}
: cancelled,
);
const handle = descriptorCleanup.handles[0];
if (handle === undefined) throw new Error("Expected owned reply descriptor");
expect(handle.fd).toBeGreaterThanOrEqual(0);
Expand Down
2 changes: 1 addition & 1 deletion tests/boundary/sqlite/sqliteDatabaseProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ nativeTest(
const controller = new AbortController();
let ownedRoot = "";
let pid: number | undefined;
const provider = new SqliteDatabaseProvider({}, async (spawn) => {
const provider = new SqliteDatabaseProvider(process.env, async (spawn) => {
ownedRoot = spawn.cwd ?? "";
const requestPath = spawn.arguments[2];
if (requestPath === undefined)
Expand Down
Loading