test: invalidate producer-cache in asset dispatch tests (mirror deploy)

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) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-06-18 15:01:47 +00:00
parent 3d3bac9e13
commit 25d388fab8
+6
View File
@@ -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(())
}