Files
upaas/internal/service/webhook
sneak c377eb2f5e
Check / check (pull_request) Skipped
Fix flaky t.TempDir cleanup race in webhook tests (closes #198)
HandleWebhook starts a deployment in a detached goroutine that keeps
writing under the app data dir (the test's t.TempDir). The webhook
tests slept 100ms and returned, racing Go's automatic TempDir cleanup
and intermittently failing with "RemoveAll: directory not empty".

Track those goroutines in a sync.WaitGroup on the webhook Service and
expose WaitForDeployments; the tests now wait on it instead of
sleeping. Deploy joins its own sub-goroutines before returning, so the
wait covers every temp-dir write. Production behavior is unchanged
apart from making completion observable.

Model: opus-4-8
2026-09-22 09:56:15 +00:00
..