Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): free worktrees for terminal thread statuses #15150

MergedANSHSINGH050404(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/15150/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 48 additions and 1 deletion.

x
0 of 2 viewed, 2 left
42 additions and 0 deletionsapps/server/src/storageCleanup.test.tsModified
View file
@@ -3,6 +3,7 @@
ProjectId,
ProviderInstanceId,
RunId,
+ RuntimeRequestId,
ThreadId,
type OrchestrationV2ThreadShell,
} from "@t3tools/contracts";
@@ -80,6 +81,47 @@
},
);
​
+ it.each(["idle", "completed", "interrupted", "failed", "cancelled", "rolled_back"] as const)(
+ "allows cleanup once its thread is %s",
+ (status) => {
+ expect(storageCleanupThreadIdle(candidateWithStatus(status), NOW_MS)).toBe(true);
+ },
+ );
+​
+ it.each(["completed", "interrupted", "cancelled", "rolled_back"] as const)(
+ "retains %s while background work is pending",
+ (status) => {
+ expect(
+ storageCleanupThreadIdle(
+ {
+ ...candidateWithStatus(status),
+ pendingBackgroundTasks: [{ taskId: "task-1", kind: "command" }],
+ },
+ NOW_MS,