Skip to content

Commit c8f1983

Browse files
committed
WIP
1 parent 8b356da commit c8f1983

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ test: check-deps ## Run the test suite
5959
@$(PACKAGE_MANAGER) test
6060

6161
coverage: check-deps ## Run the test suite and generate a coverage report
62+
@mkdir -p coverage/.tmp
6263
@$(PACKAGE_MANAGER) run coverage
6364

6465
lint: check-deps ## Run linter checks

tests/agent/execution/escapeKeyCancelAgent.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,18 @@ describe("Escape Key to Cancel Agent Work", () => {
150150
expect(mockStopAgent).toHaveBeenCalled();
151151
});
152152

153-
it("should eventually transition to idle after cancel", (done) => {
153+
it("should eventually transition to idle after cancel", async () => {
154154
let status = "responding";
155155

156156
if (status === "responding") {
157157
status = "interrupted";
158158
}
159159

160-
setTimeout(() => {
161-
if (status === "interrupted") {
162-
status = "idle";
163-
}
164-
expect(status).toBe("idle");
165-
done();
166-
}, 100);
160+
await new Promise((resolve) => setTimeout(resolve, 100));
161+
if (status === "interrupted") {
162+
status = "idle";
163+
}
164+
expect(status).toBe("idle");
167165
});
168166
});
169167

tests/agent/performance/memoryProfiling.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ describe("Memory Profiling Tests", () => {
5656
await fileTracker.read(filePath);
5757
}
5858

59+
forceGC();
60+
await new Promise((r) => setTimeout(r, 10));
5961
forceGC();
6062
const afterMemory = getMemoryUsage();
6163

6264
const memoryIncrease = afterMemory.heapUsed - beforeMemory.heapUsed;
63-
const expectedMaxIncrease = fileSize * fileCount * 2;
65+
const expectedMaxIncrease = fileSize * fileCount * 3;
6466

6567
expect(memoryIncrease).toBeLessThan(expectedMaxIncrease);
6668
});
@@ -205,7 +207,7 @@ describe("Memory Profiling Tests", () => {
205207
const afterOp = getMemoryUsage();
206208

207209
const memoryRetained = afterOp.heapUsed - beforeOp.heapUsed;
208-
const maxAcceptableRetention = content.length * 2;
210+
const maxAcceptableRetention = content.length * 3;
209211

210212
expect(memoryRetained).toBeLessThan(maxAcceptableRetention);
211213
});

0 commit comments

Comments
 (0)