diff --git a/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts b/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts index ad7130f0f7ee7..654184093cc2d 100644 --- a/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts +++ b/src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts @@ -893,7 +893,14 @@ export function defineComponentFixture(options: ComponentFixtureOptions): Themed // during dispose to drain async cleanup work (e.g. `Promise.race` // guards behind `timeout(1000)` that hold references until they // settle) before the leak tracker checks for undisposed objects. - const clock = new VirtualClock(Date.now()); + // + // Seed the clock with a fixed wall-clock time so any code under + // test that reads `Date.now()` / `new Date()` produces the same + // values run after run. Real time would otherwise leak in + // through this seed and make screenshots that include + // time-derived labels (e.g. "1 hour ago", "Today") drift + // across days, hour boundaries, and DST changes. + const clock = new VirtualClock(new Date('2026-05-14T12:00:00Z').getTime()); const p = new VirtualTimeProcessor( clock, drainMicrotasksEmbedding(realTimeApi),