Public: anyone can read this; the crew can change it.
Full suite red: test/agents.test.ts #12808
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/12794-full-suite-red-test-agents-test-ts → main 5 commits fork
2 files
changed +8
−6
src/core/webhooks.ts +4 −2
| @@ -324,6 +324,7 @@ export async function deliverDue( | ||
| 324 | 324 | now = new Date(), |
| 325 | 325 | outbound: OutboundOptions = {}, |
| 326 | 326 | bus: EventBus = new EventBus(db), |
| 327 | timeoutMs: number = DELIVER_TIMEOUT_MS, | |
| 327 | 328 | ): Promise<number> { |
| 328 | 329 | const nowIso = now.toISOString(); |
| 329 | 330 | const events = db |
| @@ -375,7 +376,7 @@ export async function deliverDue( | ||
| 375 | 376 | ); |
| 376 | 377 | if (claimed.changes !== 1) continue; |
| 377 | 378 | try { |
| 378 | await deliverOne(db, log, row, now, outbound, bus); | |
| 379 | await deliverOne(db, log, row, now, outbound, bus, timeoutMs); | |
| 379 | 380 | } catch (error) { |
| 380 | 381 | // One malformed delivery must not take the batch with it. Without |
| 381 | 382 | // this, a single unsendable row stops every delivery behind it — and |
| @@ -405,6 +406,7 @@ async function deliverOne( | ||
| 405 | 406 | now: Date, |
| 406 | 407 | outbound: OutboundOptions, |
| 407 | 408 | bus: EventBus, |
| 409 | timeoutMs: number, | |
| 408 | 410 | ): Promise<void> { |
| 409 | 411 | // A ping's body is its payload as it stands: { kind, repo, hook, at }. |
| 410 | 412 | const body = |
| @@ -437,7 +439,7 @@ async function deliverOne( | ||
| 437 | 439 | : { "x-forge-signature-256": `sha256=${signature}` }), |
| 438 | 440 | }, |
| 439 | 441 | body, |
| 440 | signal: AbortSignal.timeout(DELIVER_TIMEOUT_MS), | |
| 442 | signal: AbortSignal.timeout(timeoutMs), | |
| 441 | 443 | redirect: "manual", |
| 442 | 444 | }, |
| 443 | 445 | outbound, |
test/agents.test.ts +4 −4
| @@ -973,11 +973,11 @@ describe("git process limits and timeouts", () => { | ||
| 973 | 973 | await deliverDue(app.db, app.log, new Date(), { |
| 974 | 974 | allow: ["127.0.0.1", "::1"], |
| 975 | 975 | plain: true, |
| 976 | }); | |
| 976 | }, undefined, 300); | |
| 977 | 977 | const elapsed = Date.now() - started; |
| 978 | // The delivery timeout is 10s; anything under 30 proves a signal fired | |
| 979 | // rather than the request hanging on forever. | |
| 980 | expect(elapsed).toBeLessThan(30_000); | |
| 978 | // A 300 ms delivery timeout: coming back well under 2 s proves the | |
| 979 | // signal fired rather than the request hanging on forever. | |
| 980 | expect(elapsed).toBeLessThan(2_000); | |
| 981 | 981 | const row = app.db |
| 982 | 982 | .query< |
| 983 | 983 | { attempts: number; state: string }, |
new above
offline