test(background-agent): update completion timer test for per-task cleanup

Test expected timers only after allComplete, but H2 fix intentionally
decoupled per-task cleanup from sibling completion state. Updated
assertion to expect timer after individual task notification.
This commit is contained in:
YeonGyu-Kim
2026-03-11 20:15:16 +09:00
parent deaac8cb39
commit b8aea50dfa

View File

@@ -3785,7 +3785,7 @@ describe("BackgroundManager.completionTimers - Memory Leak Fix", () => {
manager.shutdown() manager.shutdown()
}) })
test("should start cleanup timers only after all tasks complete", async () => { test("should start per-task cleanup timers independently of sibling completion", async () => {
// given // given
const client = { const client = {
session: { session: {
@@ -3832,7 +3832,7 @@ describe("BackgroundManager.completionTimers - Memory Leak Fix", () => {
// then // then
const completionTimers = getCompletionTimers(manager) const completionTimers = getCompletionTimers(manager)
expect(completionTimers.size).toBe(0) expect(completionTimers.size).toBe(1)
// when // when
await (manager as unknown as { notifyParentSession: (task: BackgroundTask) => Promise<void> }) await (manager as unknown as { notifyParentSession: (task: BackgroundTask) => Promise<void> })