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.

chore(replay): pin ml-mirror test clock (#108531)

Raúl Negrón-Oteroa2eaf29d42bf
diff --git a/nodejs/tests/helpers/ml-mirror-staged-batch.ts b/nodejs/tests/helpers/ml-mirror-staged-batch.ts
index 41be5941b642..f3fff7a964b7 100644
--- a/nodejs/tests/helpers/ml-mirror-staged-batch.ts
+++ b/nodejs/tests/helpers/ml-mirror-staged-batch.ts
@@ -32,7 +32,7 @@ import { BatchCommitter } from '~/ingestion/pipelines/sessionreplay/staged-batch
import { TeamForReplay } from '~/ingestion/pipelines/sessionreplay/teams/types'
import { createMockIngestionOutputs } from '~/tests/helpers/mock-ingestion-outputs'
-/** Test-only: the runner the ML mirror server builds, started on one pipeline config. */
+/** Test-only: the runner the ML mirror server builds, started on one pipeline config. The clock defaults to one hour after the 2026-09-15T12:00Z the test session IDs start at, so the 14-day session age filter keeps them. */
export function buildMlMirrorStagedRunner(
config: SessionReplayPipelineConfig,
mlOptions: MlMirrorPipelineOptions,
@@ -40,7 +40,12 @@ export function buildMlMirrorStagedRunner(
collection?: MlMirrorCollection,
urlFetch?: MlMirrorUrlFetchProducer
): MlMirrorStagedBatchRunner {
- const runner = new MlMirrorStagedBatchRunner(mlOptions, imageScrub, collection, urlFetch)
+ const runner = new MlMirrorStagedBatchRunner(
+ { nowMs: () => Date.UTC(2026, 8, 15, 13), ...mlOptions },
+ imageScrub,
+ collection,
+ urlFetch
+ )
runner.start(config)
return runner
}