Skip to content

Commit 57361b3

Browse files
committed
fix(server): retry busy Antigravity validation cleanup
1 parent 5270d25 commit 57361b3

2 files changed

Lines changed: 72 additions & 58 deletions

File tree

‎apps/server/src/provider/AntigravityInstallation.test.ts‎

Lines changed: 69 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -308,61 +308,73 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => {
308308
}),
309309
);
310310

311-
it.effect.each([
312-
{
313-
name: "the expected release with protocol 1",
314-
protocolVersion: 1,
315-
agentName: "antigravity-acp",
316-
version: "fixture-new",
317-
valid: true,
318-
},
319-
{
320-
name: "the expected release with protocol 2 and legacy fields",
321-
protocolVersion: 2,
322-
agentName: "antigravity-acp",
323-
version: "fixture-new",
324-
valid: true,
325-
},
326-
{
327-
name: "an unsupported protocol version",
328-
protocolVersion: 3,
329-
agentName: "antigravity-acp",
330-
version: "fixture-new",
331-
valid: false,
332-
},
333-
{ name: "a different agent", agentName: "other-agent", version: "fixture-new", valid: false },
334-
{
335-
name: "a different version",
336-
agentName: "antigravity-acp",
337-
version: "other-version",
338-
valid: false,
339-
},
340-
{
341-
name: "the Windows ARM release with locked child processes",
342-
platform: "win32" as const,
343-
arch: "arm64" as const,
344-
agentName: "antigravity-acp",
345-
version: "fixture-new",
346-
valid: true,
347-
},
348-
{
349-
name: "an invalid Windows ARM release with locked child processes",
350-
platform: "win32" as const,
351-
arch: "arm64" as const,
352-
agentName: "antigravity-acp",
353-
version: "other-version",
354-
valid: false,
355-
},
356-
{
357-
name: "a cancelled Windows ARM verification with locked child processes",
358-
platform: "win32" as const,
359-
arch: "arm64" as const,
360-
agentName: "antigravity-acp",
361-
version: "fixture-new",
362-
cancel: true,
363-
valid: false,
364-
},
365-
])("validates $name with initialize only and removes the disposable profile", (testCase) =>
311+
it.effect.each(
312+
[
313+
{
314+
name: "the expected release with protocol 1",
315+
protocolVersion: 1,
316+
agentName: "antigravity-acp",
317+
version: "fixture-new",
318+
valid: true,
319+
},
320+
{
321+
name: "the expected release with protocol 2 and legacy fields",
322+
protocolVersion: 2,
323+
agentName: "antigravity-acp",
324+
version: "fixture-new",
325+
valid: true,
326+
},
327+
{
328+
name: "an unsupported protocol version",
329+
protocolVersion: 3,
330+
agentName: "antigravity-acp",
331+
version: "fixture-new",
332+
valid: false,
333+
},
334+
{ name: "a different agent", agentName: "other-agent", version: "fixture-new", valid: false },
335+
{
336+
name: "a different version",
337+
agentName: "antigravity-acp",
338+
version: "other-version",
339+
valid: false,
340+
},
341+
{
342+
name: "the Windows ARM release with locked child processes",
343+
platform: "win32" as const,
344+
arch: "arm64" as const,
345+
agentName: "antigravity-acp",
346+
version: "fixture-new",
347+
valid: true,
348+
},
349+
{
350+
name: "an invalid Windows ARM release with locked child processes",
351+
platform: "win32" as const,
352+
arch: "arm64" as const,
353+
agentName: "antigravity-acp",
354+
version: "other-version",
355+
valid: false,
356+
},
357+
{
358+
name: "a cancelled Windows ARM verification with locked child processes",
359+
platform: "win32" as const,
360+
arch: "arm64" as const,
361+
agentName: "antigravity-acp",
362+
version: "fixture-new",
363+
cancel: true,
364+
valid: false,
365+
},
366+
].flatMap((testCase) => {
367+
const cleanupErrorTags =
368+
testCase.platform === "win32"
369+
? (["Unknown", "PermissionDenied", "Busy"] as const)
370+
: (["Unknown"] as const);
371+
return cleanupErrorTags.map((cleanupErrorTag) => ({
372+
...testCase,
373+
cleanupErrorTag,
374+
name: `${cleanupErrorTag}: ${testCase.name}`,
375+
}));
376+
}),
377+
)("validates $name with initialize only and removes the disposable profile", (testCase) =>
366378
Effect.gen(function* () {
367379
const fs = yield* FileSystem.FileSystem;
368380
const platform = testCase.platform ?? hostPlatform;
@@ -496,10 +508,10 @@ it.layer(NodeServices.layer)("Antigravity installation", (it) => {
496508
Effect.andThen(
497509
Effect.fail(
498510
PlatformError.systemError({
499-
_tag: "Unknown",
511+
_tag: testCase.cleanupErrorTag,
500512
module: "FileSystem",
501513
method: "remove",
502-
description: "EPERM: unpacked DLL is in use",
514+
description: "Unpacked DLL is in use",
503515
}),
504516
),
505517
),

‎apps/server/src/provider/AntigravityInstallation.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ export const makeAntigravityInstallation = Effect.fn("AntigravityInstallation.ma
360360
times: platform === "win32" ? 10 : 0,
361361
schedule: Schedule.spaced("100 millis"),
362362
while: (error) =>
363-
error.reason._tag === "PermissionDenied" || error.reason._tag === "Unknown",
363+
error.reason._tag === "PermissionDenied" ||
364+
error.reason._tag === "Busy" ||
365+
error.reason._tag === "Unknown",
364366
}),
365367
Effect.orDie,
366368
),

0 commit comments

Comments
 (0)