Wait for webhook deployments in handlers tests instead of sleeping (closes #211) #212

Merged
clawbot merged 1 commits from issue-211-handlers-webhook-wait into next 2026-09-23 03:04:31 +02:00
Collaborator

Replaces the 100ms sleep in TestHandleWebhookProcessesValidWebhook with a call to the webhook service's WaitForDeployments, the same fix #198 applied to the webhook service tests. The test context now keeps the webhook service that setupTestHandlers already built. No production code changes.

Only this test can start a deployment. TestHandleWebhookRejectsOversizedBody sends a payload that does not parse, so its branch is empty and never matches the app branch. TestHandleWebhookReturns404ForUnknownSecret returns before it reaches the webhook service. Neither needs a wait.

make check is green.

Closes #211

Model: opus-5-5

Replaces the 100ms sleep in `TestHandleWebhookProcessesValidWebhook` with a call to the webhook service's `WaitForDeployments`, the same fix https://git.eeqj.de/sneak/upaas/issues/198 applied to the webhook service tests. The test context now keeps the webhook service that `setupTestHandlers` already built. No production code changes. Only this test can start a deployment. `TestHandleWebhookRejectsOversizedBody` sends a payload that does not parse, so its branch is empty and never matches the app branch. `TestHandleWebhookReturns404ForUnknownSecret` returns before it reaches the webhook service. Neither needs a wait. `make check` is green. Closes https://git.eeqj.de/sneak/upaas/issues/211 Model: opus-5-5
clawbot added the needs-review label 2026-09-23 02:33:42 +02:00
clawbot self-assigned this 2026-09-23 02:33:42 +02:00
Author
Collaborator

FAIL (needs-rework), tested 2d031f6 rebased onto next 567f982.

  • TODO.md, new Completed Steps entry: "Fixed the same t.TempDir cleanup race" has nothing to refer back to. The entry it means (the internal/service/webhook fix for #198) is two entries further down, so someone reading top-down cannot tell which race this is. The entry should name the race itself, for example: "Fixed the flaky t.TempDir cleanup race in internal/handlers (the one fixed in internal/service/webhook by #198): TestHandleWebhookProcessesValidWebhook now waits with the webhook service's WaitForDeployments instead of sleeping (#211)."

The test change, the PR body and the commit message are otherwise correct.

Model: opus-5-5

FAIL (needs-rework), tested `2d031f6` rebased onto `next` `567f982`. - `TODO.md`, new Completed Steps entry: "Fixed the same `t.TempDir` cleanup race" has nothing to refer back to. The entry it means (the `internal/service/webhook` fix for https://git.eeqj.de/sneak/upaas/issues/198) is two entries further down, so someone reading top-down cannot tell which race this is. The entry should name the race itself, for example: "Fixed the flaky `t.TempDir` cleanup race in `internal/handlers` (the one fixed in `internal/service/webhook` by #198): `TestHandleWebhookProcessesValidWebhook` now waits with the webhook service's `WaitForDeployments` instead of sleeping (#211)." The test change, the PR body and the commit message are otherwise correct. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-09-23 02:37:23 +02:00
Author
Collaborator

Rebased onto next (567f982). TODO.md entry now names the race itself (the t.TempDir cleanup race fixed in internal/service/webhook by #198) instead of saying "the same". make check green.

Model: opus-5-5

Rebased onto `next` (`567f982`). `TODO.md` entry now names the race itself (the `t.TempDir` cleanup race fixed in `internal/service/webhook` by https://git.eeqj.de/sneak/upaas/issues/198) instead of saying "the same". `make check` green. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-09-23 02:46:32 +02:00
clawbot added 1 commit 2026-09-23 02:46:33 +02:00
TestHandleWebhookProcessesValidWebhook slept 100ms after posting a
webhook, racing the background deployment that writes its log under the
test's temp directory against temp directory cleanup. The test context
now keeps the webhook service, and the test waits on its
WaitForDeployments, as the webhook service tests already do. The other
webhook handler tests never start a deployment.

Model: opus-5-5
clawbot force-pushed issue-211-handlers-webhook-wait from 2d031f6fad to e8e545f5b1 2026-09-23 02:46:33 +02:00 Compare
Author
Collaborator

PASS, tested e8e545f rebased onto next 567f982.

Model: opus-5-5

PASS, tested `e8e545f` rebased onto `next` `567f982`. Model: opus-5-5
clawbot merged commit 19619b1cd2 into next 2026-09-23 03:04:31 +02:00
clawbot deleted branch issue-211-handlers-webhook-wait 2026-09-23 03:04:31 +02:00
Sign in to join this conversation.