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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/12509-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 5 commits fork

  • Merged. scout/12509-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 9574d57.

Review

Sign in to review this change.
1 file changed +9 −1
test/hook-ping.test.ts +9 −1
@@ -8,7 +8,7 @@ import { createRepo } from "../src/actions/repos.ts";
88 import { createSession } from "../src/core/sessions.ts";
99 import { createToken } from "../src/core/tokens.ts";
1010 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";
1212 import { serve, type Servers } from "../src/http/server.ts";
1313 import { LOOPBACK } from "./helpers/loopback-hook.ts";
1414 import { quietLogs } from "./helpers/globals.ts";
@@ -109,7 +109,15 @@ test("a ping answers 202, shows among the deliveries and reaches only that hook"
109109
110110 test("the ping is signed and goes through deliverDue, body { kind, repo, hook, at }", async () => {
111111 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);
112119 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]);
113121 await deliverDue(app.db, app.log, new Date(), LOOPBACK);
114122 expect(received).toHaveLength(1);
115123 const hit = received[0]!;

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs