Skip to content

Commit 4e915ad

Browse files
committed
🤖 ci: fix unit tests after compaction changes
1 parent 7e30685 commit 4e915ad

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/browser/utils/messages/compactionOptions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe("applyCompactionOverrides", () => {
7474
const result = applyCompactionOverrides(baseWithTools, compactData);
7575

7676
expect(result.mode).toBe("compact");
77-
expect(result.toolPolicy).toEqual([{ regex_match: ".*", action: "disable" }]); // Tools always disabled for compaction
77+
expect(result.toolPolicy).toEqual([{ regex_match: ".*", action: "disable" }]);
7878
});
7979

8080
it("applies all overrides together", () => {

src/node/services/serverService.test.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,18 @@ describe("ServerService.startServer", () => {
7777
}
7878

7979
test("cleans up server when lockfile acquisition fails", async () => {
80-
// Skip on Windows where chmod doesn't work the same way
81-
if (process.platform === "win32") {
82-
return;
83-
}
84-
8580
const service = new ServerService();
8681

87-
// Make muxHome read-only so lockfile.acquire() will fail
88-
await fs.chmod(tempDir, 0o444);
82+
// Make muxHome a file (not a directory) so lockfile.acquire fails deterministically.
83+
const muxHomeFile = path.join(tempDir, "not-a-dir");
84+
await fs.writeFile(muxHomeFile, "not a directory");
8985

9086
let thrownError: Error | null = null;
9187

9288
try {
9389
// Start server - this should fail when trying to write lockfile
9490
await service.startServer({
95-
muxHome: tempDir,
91+
muxHome: muxHomeFile,
9692
context: stubContext as ORPCContext,
9793
authToken: "test-token",
9894
port: 0, // random port
@@ -103,7 +99,7 @@ describe("ServerService.startServer", () => {
10399

104100
// Verify that an error was thrown
105101
expect(thrownError).not.toBeNull();
106-
expect(thrownError!.message).toMatch(/EACCES|permission denied/i);
102+
expect(thrownError!.message).toMatch(/ENOTDIR|not a directory/i);
107103

108104
// Verify the server is NOT left running
109105
expect(service.isServerRunning()).toBe(false);

0 commit comments

Comments
 (0)