Skip to content

Commit cc9eabd

Browse files
authored
test(webapp): use relative fixture dates in runs cursor pagination tests (#3912)
## Summary `test/runsRepositoryCursor.test.ts` pinned its fixture runs to `createdAt = 2026-06-04T16:55:07Z`. `listRuns` applies the default 7 day window when no time filter is given, so the fixtures aged out of the window at 16:55 UTC on 2026-06-11 and all five tests started failing for every branch, regardless of what the branch changed. The tests were green on their own CI two days earlier because the fixtures were only five days old at the time. This switches the fixture base to a relative timestamp (one hour ago), so the fixtures stay inside the default window permanently. Verified the suite goes 5/5 green with this change on the same environment where the pinned dates fail 5/5.
1 parent 187c047 commit cc9eabd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

apps/webapp/test/runsRepositoryCursor.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("RunsRepository cursor pagination", () => {
7070
"dddddddddddddddddddddddd",
7171
"eeeeeeeeeeeeeeeeeeeeeeee",
7272
];
73-
const base = new Date("2026-06-04T16:55:07.000Z").getTime();
73+
const base = Date.now() - 60 * 60 * 1000; // relative, so fixtures never age out of the default 7d window
7474
for (let i = 0; i < ids.length; i++) {
7575
await prisma.taskRun.create({
7676
data: {
@@ -160,7 +160,7 @@ describe("RunsRepository cursor pagination", () => {
160160
"bbbbbbbbbbbbbbbbbbbbbbbb",
161161
"cccccccccccccccccccccccc",
162162
];
163-
const base = new Date("2026-06-04T16:55:07.000Z").getTime();
163+
const base = Date.now() - 60 * 60 * 1000; // relative, so fixtures never age out of the default 7d window
164164
for (let i = 0; i < ids.length; i++) {
165165
await prisma.taskRun.create({
166166
data: {
@@ -255,7 +255,7 @@ describe("RunsRepository cursor pagination", () => {
255255
"bbbbbbbbbbbbbbbbbbbbbbbb",
256256
"cccccccccccccccccccccccc",
257257
];
258-
const base = new Date("2026-06-04T16:55:07.000Z").getTime();
258+
const base = Date.now() - 60 * 60 * 1000; // relative, so fixtures never age out of the default 7d window
259259
for (let i = 0; i < ids.length; i++) {
260260
await prisma.taskRun.create({
261261
data: {
@@ -339,7 +339,7 @@ describe("RunsRepository cursor pagination", () => {
339339
"dddddddddddddddddddddddd",
340340
"eeeeeeeeeeeeeeeeeeeeeeee",
341341
];
342-
const base = new Date("2026-06-04T16:55:07.000Z").getTime();
342+
const base = Date.now() - 60 * 60 * 1000; // relative, so fixtures never age out of the default 7d window
343343
for (let i = 0; i < ids.length; i++) {
344344
await prisma.taskRun.create({
345345
data: {
@@ -458,7 +458,7 @@ describe("RunsRepository cursor pagination", () => {
458458
"bbbbbbbbbbbbbbbbbbbbbbbb",
459459
"cccccccccccccccccccccccc",
460460
];
461-
const base = new Date("2026-06-04T16:55:07.000Z").getTime();
461+
const base = Date.now() - 60 * 60 * 1000; // relative, so fixtures never age out of the default 7d window
462462
for (let i = 0; i < ids.length; i++) {
463463
await prisma.taskRun.create({
464464
data: {

0 commit comments

Comments
 (0)