TestHandleWebhookProcessesValidWebhook in internal/handlers/handlers_test.go failed once in make check during the rework of #210 (unrelated to that change). A re-run passed. The failure is a t.TempDir cleanup race: the webhook starts a deployment in the background, that deployment writes its log file under the data directory (the test's temp directory), and the test returns while the write is still happening.
The test waits with time.Sleep(100 * time.Millisecond). This is the same race fixed for internal/service/webhook in #198, which added WaitForDeployments to the webhook service. The handlers tests were not changed then.
Implementation: keep the webhook service that setupTestHandlers already builds (webhookSvc) on testContext, and in TestHandleWebhookProcessesValidWebhook replace the sleep with a call to its WaitForDeployments, using the same comment wording as the webhook tests. Check the other handlers tests that post to a webhook (for example TestHandleWebhookRejectsOversizedBody) and add the same wait wherever a deployment can start. No production code change.
Definition of done:
No time.Sleep is used to wait for deployments in internal/handlers tests.
Every handlers test that can start a deployment waits for it with WaitForDeployments before returning.
make check is green (linting in Docker). PR based on next.
Model: opus-5-5
`TestHandleWebhookProcessesValidWebhook` in `internal/handlers/handlers_test.go` failed once in `make check` during the rework of https://git.eeqj.de/sneak/upaas/pulls/210 (unrelated to that change). A re-run passed. The failure is a `t.TempDir` cleanup race: the webhook starts a deployment in the background, that deployment writes its log file under the data directory (the test's temp directory), and the test returns while the write is still happening.
The test waits with `time.Sleep(100 * time.Millisecond)`. This is the same race fixed for `internal/service/webhook` in https://git.eeqj.de/sneak/upaas/issues/198, which added `WaitForDeployments` to the webhook service. The handlers tests were not changed then.
Implementation: keep the webhook service that `setupTestHandlers` already builds (`webhookSvc`) on `testContext`, and in `TestHandleWebhookProcessesValidWebhook` replace the sleep with a call to its `WaitForDeployments`, using the same comment wording as the webhook tests. Check the other handlers tests that post to a webhook (for example `TestHandleWebhookRejectsOversizedBody`) and add the same wait wherever a deployment can start. No production code change.
Definition of done:
- No `time.Sleep` is used to wait for deployments in `internal/handlers` tests.
- Every handlers test that can start a deployment waits for it with `WaitForDeployments` before returning.
- `make check` is green (linting in Docker). PR based on `next`.
Model: opus-5-5
clawbot
added the bug label 2026-09-23 02:28:53 +02:00
Built in #212: TestHandleWebhookProcessesValidWebhook now waits with WaitForDeployments instead of sleeping. It is the only handlers test that can start a deployment. The oversized-body test sends a payload that does not parse, so its branch never matches.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/upaas/pulls/212: `TestHandleWebhookProcessesValidWebhook` now waits with `WaitForDeployments` instead of sleeping. It is the only handlers test that can start a deployment. The oversized-body test sends a payload that does not parse, so its branch never matches.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
TestHandleWebhookProcessesValidWebhookininternal/handlers/handlers_test.gofailed once inmake checkduring the rework of #210 (unrelated to that change). A re-run passed. The failure is at.TempDircleanup race: the webhook starts a deployment in the background, that deployment writes its log file under the data directory (the test's temp directory), and the test returns while the write is still happening.The test waits with
time.Sleep(100 * time.Millisecond). This is the same race fixed forinternal/service/webhookin #198, which addedWaitForDeploymentsto the webhook service. The handlers tests were not changed then.Implementation: keep the webhook service that
setupTestHandlersalready builds (webhookSvc) ontestContext, and inTestHandleWebhookProcessesValidWebhookreplace the sleep with a call to itsWaitForDeployments, using the same comment wording as the webhook tests. Check the other handlers tests that post to a webhook (for exampleTestHandleWebhookRejectsOversizedBody) and add the same wait wherever a deployment can start. No production code change.Definition of done:
time.Sleepis used to wait for deployments ininternal/handlerstests.WaitForDeploymentsbefore returning.make checkis green (linting in Docker). PR based onnext.Model: opus-5-5
Built in #212:
TestHandleWebhookProcessesValidWebhooknow waits withWaitForDeploymentsinstead of sleeping. It is the only handlers test that can start a deployment. The oversized-body test sends a payload that does not parse, so its branch never matches.Model: opus-5-5