From 6f6c4ffff0f27ba0737a842bc5b98cb172b1f591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 27 Sep 2026 19:51:46 +0200 Subject: [PATCH] test(jobs): re-pin the pg-boss retention assumptions to 12.34.0 --- src/lib/jobs/__tests__/job-failures-retention.test.ts | 7 +++++-- src/lib/jobs/job-failures.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/jobs/__tests__/job-failures-retention.test.ts b/src/lib/jobs/__tests__/job-failures-retention.test.ts index ef3858164..7a0674c9b 100644 --- a/src/lib/jobs/__tests__/job-failures-retention.test.ts +++ b/src/lib/jobs/__tests__/job-failures-retention.test.ts @@ -16,12 +16,15 @@ describe("pg-boss failed-row ledger retention", () => { ) as { version: string }; const plans = readFileSync(join(PG_BOSS_ROOT, "dist/plans.js"), "utf8"); - expect(packageJson.version).toBe("12.27.0"); + expect(packageJson.version).toBe("12.34.0"); expect(plans).toContain("retention_seconds: FORTEEN_DAYS"); expect(plans).toContain("deletion_seconds: SEVEN_DAYS"); + // 12.34 reads the clock through job_now(), which is pg_catalog.now() + // unless a test clock opts in, so the seven-day deletion is unchanged. expect(plans).toContain( - "completed_on + deletion_seconds * interval '1s' < now()", + "completed_on + deletion_seconds * interval '1s' < ${schema}.job_now()", ); + expect(plans).toContain("CLOCK_FUNCTION_BODY = 'SELECT pg_catalog.now();'"); expect(JOB_FAILURE_WINDOW_HOURS).toBeLessThan( PG_BOSS_FAILED_ROW_AVAILABILITY_HOURS, ); diff --git a/src/lib/jobs/job-failures.ts b/src/lib/jobs/job-failures.ts index 6406e320c..793dae392 100644 --- a/src/lib/jobs/job-failures.ts +++ b/src/lib/jobs/job-failures.ts @@ -28,7 +28,7 @@ import { prisma } from "@/lib/db"; import { redactSecrets } from "@/lib/logging/redact"; /** - * pg-boss 12.26.0 stores terminal rows until + * pg-boss 12.34.0 stores terminal rows until * `completed_on + deletion_seconds` (`dist/plans.js`). Its queue default is * 604800 seconds, while `retention_seconds` defaults to 1209600 seconds; job * insertion copies those queue values and maintenance applies the terminal-row