Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): cleanup keeps worktrees waiting for a usage-limit reset #24689

Mergedonly21mil(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/24689/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 151 additions and 13 deletions.

x
0 of 2 viewed, 2 left
103 additions and 5 deletionsapps/server/src/storageCleanup.test.tsModified
View file
@@ -112,14 +112,16 @@
const candidate = () => shell({ branch: "feature", worktreePath: "/worktrees/feature" });
​
it("allows an idle worktree and rejects the project checkout", () => {
- expect(storageCleanupThreadIdle(candidate(), NOW_MS)).toBe(true);
- expect(storageCleanupThreadIdle(shell(), NOW_MS)).toBe(false);
+ expect(storageCleanupThreadIdle(candidate(), NOW_MS, DEFAULT_SERVER_SETTINGS)).toBe(true);
+ expect(storageCleanupThreadIdle(shell(), NOW_MS, DEFAULT_SERVER_SETTINGS)).toBe(false);
});
​
it.each(["running", "starting", "preparing", "waiting", "queued"] as const)(
"retains a worktree while its thread is %s",
(status) => {
- expect(storageCleanupThreadIdle(candidateWithStatus(status), NOW_MS)).toBe(false);
+ expect(
+ storageCleanupThreadIdle(candidateWithStatus(status), NOW_MS, DEFAULT_SERVER_SETTINGS),
+ ).toBe(false);
​
@@ -133,6 +135,7 @@
pendingBackgroundTasks: [{ taskId: "task-1", kind: "command" }],
NOW_MS,
+ DEFAULT_SERVER_SETTINGS,
).toBe(false);