Skip to content

Instantly share code, notes, and snippets.

@lmaccherone
lmaccherone / README.md
Created June 4, 2026 12:42
Repro: @cloudflare/vitest-pool-workers hangs at teardown when a DO blockConcurrencyWhile IIFE both emits a console.* call and throws

Repro: @cloudflare/vitest-pool-workers hangs at teardown when a DO blockConcurrencyWhile IIFE both emits a console.* call and throws

Summary

A DurableObject whose constructor schedules ctx.blockConcurrencyWhile(async () => { ... }), and whose IIFE both (a) emits a console.* call and (b) throws, causes @cloudflare/vitest-pool-workers to hang at isolate teardown.

The test assertion passes — the hang happens after the test resolves, during vitest's process exit.

Removing either the console.* call or the throw makes vitest exit cleanly.