commit 3afd0dc326ed91c040c27a76845be6265715b605
parent 92107aae467bfd3a2b8235e6a6c6b74486ca0e9f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sun, 14 Jun 2026 00:12:12 -0400
e2e: reset the global worker pool between specs
The worker pool is a process-wide singleton like the job registry. A spec that
leaves a transcription batch running (e.g. the progress-bar test) holds global
slots; the next spec's batch then parks behind it and a drain observes zero
in-flight work. Reset __yttWorkerPool__ in the test invalidate-cache hook, the
same place the registry is reset, so each spec starts with a clean pool.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/editor/app/api/test/invalidate-cache/route.ts b/editor/app/api/test/invalidate-cache/route.ts
@@ -22,6 +22,14 @@ function invalidate() {
// from a prior spec in the same dev-server lifetime.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(globalThis as any).__yttJobRegistry__ = undefined;
+ // Reset the global worker pool for the same reason: it's a process-wide
+ // singleton whose slot accounting would otherwise carry across specs. A prior
+ // spec that left a batch running (holding global slots) would starve the next
+ // spec's batch. A detached transcription's lease.release() targets the old
+ // pool object and is harmless; the fresh pool re-seeds from settings on first
+ // use. (In production the pool legitimately persists; this is e2e-only.)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ (globalThis as any).__yttWorkerPool__ = undefined;
revalidatePath("/", "layout");
return NextResponse.json({ ok: true });
}