fix(browser): release scenario listeners and allow bounded Chrome close (#2441)

* fix(browser): release scenario event listeners on finish

* fix(browser): allow Chrome cleanup to complete within bounded deadline

* style(browser): format cleanup deadline regression

* test(browser): expect popup cleanup listener

---------

Co-authored-by: LcokHcak <268763621+LcokHcak@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
LcokHcak
2026-10-13 22:16:25 +08:00
committed by GitHub
co-authored by LcokHcak morluto
parent 9b08c2b1cb
commit c9982ad8bf
5 changed files with 263 additions and 36 deletions
@@ -164,7 +164,15 @@ it("keeps attached-target ownership after the cleanup response timeout", async (
cleanup: { reason: expect.stringContaining("timed out") },
});
await closeStarted.promise;
await vi.advanceTimersByTimeAsync(1_000);
let responseSettled = false;
void timedOutClose
.finally(() => {
responseSettled = true;
})
.catch(() => {});
await vi.advanceTimersByTimeAsync(29_999);
expect(responseSettled).toBe(false);
await vi.advanceTimersByTimeAsync(1);
await timeoutExpectation;
expect(settled).toEqual([]);