Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2kakdc4hcr is past its budget: trevato/forge: "the ping is signed and goes through deliverDue, body { kind, repo, hook, at }" failed on 3 pulls in the… #12510
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/12509-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 5 commits fork
1 file
changed +9
−1
test/hook-ping.test.ts +9 −1
| @@ -8,7 +8,7 @@ import { createRepo } from "../src/actions/repos.ts"; | ||
| 8 | 8 | import { createSession } from "../src/core/sessions.ts"; |
| 9 | 9 | import { createToken } from "../src/core/tokens.ts"; |
| 10 | 10 | import { createUser } from "../src/core/users.ts"; |
| 11 | import { createWebhook, deliverDue, recentDeliveries, verifySignature } from "../src/core/webhooks.ts"; | |
| 11 | import { createWebhook, deliverDue, deliveryBusy, recentDeliveries, verifySignature } from "../src/core/webhooks.ts"; | |
| 12 | 12 | import { serve, type Servers } from "../src/http/server.ts"; |
| 13 | 13 | import { LOOPBACK } from "./helpers/loopback-hook.ts"; |
| 14 | 14 | import { quietLogs } from "./helpers/globals.ts"; |
| @@ -109,7 +109,15 @@ test("a ping answers 202, shows among the deliveries and reaches only that hook" | ||
| 109 | 109 | |
| 110 | 110 | test("the ping is signed and goes through deliverDue, body { kind, repo, hook, at }", async () => { |
| 111 | 111 | received = []; |
| 112 | // The forge's own worker ticks in the background and may already have tried | |
| 113 | // this ping against the unreachable URL (a loaded machine delays this test | |
| 114 | // long enough). Let it finish, then put the ping back as freshly queued. | |
| 115 | for (let i = 0; i < 200 && deliveryBusy(app.db); i++) { | |
| 116 | await Bun.sleep(10); // real-timer: worker batch | |
| 117 | } | |
| 118 | expect(deliveryBusy(app.db)).toBe(false); | |
| 112 | 119 | app.db.run("UPDATE webhook SET url = ?2 WHERE id = ?1", [hookA, `http://127.0.0.1:${receiver.port}/h`]); |
| 120 | app.db.run("UPDATE webhook_ping SET state = 'pending', attempts = 0, next_try_at = NULL WHERE webhook_id = ?1", [hookA]); | |
| 113 | 121 | await deliverDue(app.db, app.log, new Date(), LOOPBACK); |
| 114 | 122 | expect(received).toHaveLength(1); |
| 115 | 123 | const hit = received[0]!; |
new above
offline