From 13799af721ed4ffa206fad7948f77e11a13c9d23 Mon Sep 17 00:00:00 2001 From: Craig Lawson Date: Thu, 17 Sep 2026 22:08:14 +0100 Subject: [PATCH] Read unevaluated checks by pending entry in the exclusion test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit findUnevaluatedByMonitorId now takes the job's pendingChecks rather than a timestamp, so the test builds those entries from the ids createChecks returns. 🔧 --- .../test/integration/checksRepositoryEgressExclusion.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/test/integration/checksRepositoryEgressExclusion.test.ts b/server/test/integration/checksRepositoryEgressExclusion.test.ts index f7ac18daa..c1f2376df 100644 --- a/server/test/integration/checksRepositoryEgressExclusion.test.ts +++ b/server/test/integration/checksRepositoryEgressExclusion.test.ts @@ -79,9 +79,10 @@ describe("MongoChecksRepository degraded-egress exclusion", () => { }); it("round-trips egressStatus through createChecks and the unevaluated-checks read, leaving it absent when unset", async () => { - await repo.createChecks([makeCheck({ egressStatus: "degraded" }), makeCheck({ egressStatus: "ok" }), makeCheck()]); + const created = await repo.createChecks([makeCheck({ egressStatus: "degraded" }), makeCheck({ egressStatus: "ok" }), makeCheck()]); + const pending = created.map((check) => ({ checkId: check.id as string, createdAt: new Date(check.createdAt as string).getTime() })); - const checks = await repo.findUnevaluatedByMonitorId(MONITOR_ID.toString(), BUCKET_TIME.getTime() - 1); + const checks = await repo.findUnevaluatedByMonitorId(MONITOR_ID.toString(), pending); // The evaluator runs from this read, so the flag must survive persistence for the short-circuit to fire. expect(checks.map((check) => check.egressStatus)).toEqual(["degraded", "ok", undefined]);