From 282f97a79462610ca889e8a6b1e0f4368c2cb26f Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Mon, 22 Jun 2026 01:15:33 -0700 Subject: [PATCH] test(signals): make queue-health fixture dates relative to now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shared signals-v2 pull-request fixture used fixed updatedAt dates. PR #10 ('2026-05-23') crossed the 30-day likely-reviewable cutoff as real time advanced, so 'adds queue age buckets and likely-reviewable counts' began failing (likelyReviewable 0, expected >= 1) — breaking test shard 2 + the validate aggregator on main and every open PR. Anchor the fixture ages relative to now so the windows never drift. --- test/unit/signals-v2.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/unit/signals-v2.test.ts b/test/unit/signals-v2.test.ts index a19ab07ad0..a6f263da84 100644 --- a/test/unit/signals-v2.test.ts +++ b/test/unit/signals-v2.test.ts @@ -35,6 +35,10 @@ import { } from "../../src/signals/reward-risk"; import type { ContributorRepoStatRecord, IssueRecord, PullRequestRecord, RecentMergedPullRequestRecord, RegistrySnapshot, RepoLabelRecord, RepositoryRecord, ScoringModelSnapshotRecord } from "../../src/types"; +// Shared-fixture timestamps are relative to "now" so age-bucket / reviewability windows (e.g. the +// `< 30 days` likely-reviewable cutoff) never drift past their boundary as real time advances (no time-bomb). +const isoDaysAgo = (days: number): string => new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString(); + const repo: RepositoryRecord = { fullName: "JSONbored/gittensory", owner: "JSONbored", @@ -78,7 +82,7 @@ const pullRequests: PullRequestRecord[] = [ labels: ["bug"], linkedIssues: [1], body: "Fixes #1", - updatedAt: "2026-05-23T00:00:00.000Z", + updatedAt: isoDaysAgo(20), // recent + linked → counts as likely-reviewable (< 30 days) and stale (>= 14 days) }, { repoFullName: repo.fullName, @@ -90,7 +94,7 @@ const pullRequests: PullRequestRecord[] = [ labels: ["bug"], linkedIssues: [1], body: "Fixes #1", - updatedAt: "2026-04-01T00:00:00.000Z", + updatedAt: isoDaysAgo(82), // old → counts in the over-30-days age bucket }, ];