From 25d388fab81ef6a3aebcfc0cdc3c48b3e56878a5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 18 Jun 2026 15:01:47 +0000 Subject: [PATCH] test: invalidate producer-cache in asset dispatch tests (mirror deploy) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tests seed asset rows directly and run no notify poller, so the per-workspace producer cache went stale across tests → 0 dispatched. Clear it at the seed point, as a deploy would via notify_event. All 8 asset_trigger_dispatch tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/tests/asset_trigger_dispatch.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/tests/asset_trigger_dispatch.rs b/backend/tests/asset_trigger_dispatch.rs index 316069df08..894a98e353 100644 --- a/backend/tests/asset_trigger_dispatch.rs +++ b/backend/tests/asset_trigger_dispatch.rs @@ -75,6 +75,12 @@ async fn seed_asset_write( .bind(producer_path) .execute(db) .await?; + // The dispatcher caches the per-workspace producer set, normally + // invalidated at deploy via the notify_event poller. These tests seed + // `asset` rows directly and run no poller, so invalidate here to mirror + // what a deploy would do — otherwise a stale cache hides freshly-seeded + // producers and nothing dispatches. + windmill_queue::asset_dispatch::ASSET_PRODUCER_WRITES_CACHE.remove(WS); Ok(()) }