fix(thumbnails): keep the video fallback tested and stop the preview worker before cleanup

A video listed without a preview still renders its own element and is
released on refresh. Test teardowns and the browser reset stop the
automatic preview worker before the temp tree goes, so no preview lands
after cleanup (Windows). TESTING.md documents automatic previews.
This commit is contained in:
Vito Sansevero
2026-10-24 06:16:49 -07:00
parent 64f5b91eee
commit cfa47ccac8
10 changed files with 107 additions and 5 deletions
+7 -2
View File
@@ -423,8 +423,13 @@ class AutoThumbnailMixin:
return self._auto_thumbnailer
def close_auto_thumbnails(self):
"""Stop the capture worker (shutdown; safe when it never started)."""
thumbnailer = self._auto_thumbnailer
"""Stop the capture worker and forget it (shutdown, a test's reset).
Waits for the batch in hand, so nothing writes into the output tree
after it returns; the next use starts a fresh one.
"""
with AutoThumbnailMixin._auto_thumbnailer_lock:
thumbnailer, self._auto_thumbnailer = self._auto_thumbnailer, None
if thumbnailer is not None:
thumbnailer.close()