Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(cdp): use dynamic date window in rerun e2e test (#60851)

mendral-app[bot]aa54b5de5956
diff --git a/nodejs/src/cdp/rerun/rerun-e2e.test.ts b/nodejs/src/cdp/rerun/rerun-e2e.test.ts
index 62ee777d250d..2ff3c1d6c0fc 100644
--- a/nodejs/src/cdp/rerun/rerun-e2e.test.ts
+++ b/nodejs/src/cdp/rerun/rerun-e2e.test.ts
@@ -299,12 +299,15 @@ describe('CDP hog invocation rerun e2e', () => {
// having to manually delete the row.
// ── 2. Mimic Django POST /rerun — only the request itself is faked ──────
- // The rerun request requires a time window; we use a wide one and
- // restrict to a specific invocation_id via the optional filter field.
+ // The rerun request requires a time window; we use a wide one around
+ // "now" (the lifecycle row's scheduled_at = current time) and restrict
+ // to a specific invocation_id via the optional filter field.
+ const windowStart = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString()
+ const windowEnd = new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString()
const rerunJobId = await rerunManager.enqueue(team.id, 'hog_function', fnFetch.id, {
filter: {
- window_start: '2026-05-01T00:00:00Z',
- window_end: '2026-05-31T00:00:00Z',
+ window_start: windowStart,
+ window_end: windowEnd,
status: ['succeeded'],
invocation_ids: [originalInvocationId],
},