Functions

f
closeWithGrace(
closes: Readonly<Record<string, Promise<unknown> | null | undefined>>,
graceMs?: number
): Promise<Abandoned>

Awaits every cleanup promise in closes, but never longer than graceMs. Resolves whichever happens first: every close settles (Promise.allSettled absorbs rejections so a single failing close cannot wedge the others), or the grace timer fires. Pending closes keep running in the background after a timeout — the caller is expected to process.exit() shortly after, which terminates them anyway.

Interfaces

I
Abandoned

What closeWithGrace gave up on, and a promise for those closes finally finishing.

  • names: string[]

    The keys still pending when the grace expired. Empty when everything settled in time.

  • settled: Promise<void>

    Settles when the abandoned closes do. Already settled when nothing was abandoned.

Variables

v
CLEANUP_GRACE_MS: 10000

Default grace period for the cleanup race — generous enough for a healthy shutdown of Playwright + HTTP server + Chrome pre-launch, well under the 60 s outer kill the test runner imposes, and tuned around Firefox + Windows where browser.close() is known to deadlock for the full 60 s.