[Bug]: A paused clock still fires a timer the page sets while loading
I maintainer di solito rispondono entro 1 giorno
@microsoft-playwright-automation ci sta già lavorando.
Dal 3/11/2026.
- #43873 di @microsoft-playwright-automation — aperta
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
- Ambito
- testing-qa
Direzione di ricerca
The clock logic lives in the injected clock code, where _replayLogOnce() sets _realTime = undefined in the paused branch while _currentRealTimeTimer is left armed; compare with _innerPause(), which disposes it. Start by running the repro test from the issue under the Playwright clock tests. Done when the timer no longer fires with the clock paused, and the test asserting fired is 0 passes in Chromium, Firefox and WebKit.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
After page.clock.pauseAt(), a timer that a newly loaded page sets during load fires once by itself, without runFor or fastForward.
Version: 1.63.0 in Chromium, Firefox and WebKit; also Chromium on 1.60.0, 1.64.1 and 1.65.0-alpha-2026-11-02 (after #43224). Linux, Node 24. Not seen on 1.48 or 1.56.
Repro:
import { test, expect } from "@playwright/test";
test("a paused clock does not fire a timer the page sets while loading", async ({ page }) => {
await page.route("http://repro.test/", (route) =>
route.fulfill({
contentType: "text/html",
body: "<script>window.fired = 0; setTimeout(() => window.fired++, 0);</script>",
}),
);
await page.clock.install({ time: new Date("2024-01-15T12:00:00Z") });
await page.clock.pauseAt(new Date("2024-01-15T12:00:10Z"));
await page.goto("http://repro.test/");
await page.waitForTimeout(500);
expect(await page.evaluate(() => (window as any).fired)).toBe(0);
});
Expected: fired is 0. The clock is paused, so the timer waits for runFor.
Actual: fired is 1, 5 times out of 5 in each case above. Possibly related to #43214, but #43224 does not fix this one.
Cause: in a new document the injected clock starts running, and resume() arms the real-time timer. When _replayLogOnce() replays a log that ends paused, it sets _realTime = undefined but never disposes _currentRealTimeTimer. Up to 100 ms later that timer fires and runs _runTo(now), which fires every timer already due. Disposing the timer in the paused branch, as _innerPause() does, should fix it.
- Lingua principale
- TypeScript
- Stelle
- 99.1k
- Fork
- 6.8k
- Merge medio
- 16h 3m
- PR unite (30g)
- 315
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/playwright
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/playwright#43875 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
microsoft/playwright#43871 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Configure web servers per projectForse già presa @microsoft-playwright-automation l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
microsoft/playwright#43853 · 4 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Extend isVisible/toBeVisible API to include overlap detectionForse già presa @microsoft-playwright-automation l’ha presa oggi. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
microsoft/playwright#43849 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: connectOverCDP: a tab whose main frame was swapped in by a prerender never initializes, and title()/evaluate() hang forever (default Chrome/Edge settings)Forse già presa @dgozman l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
microsoft/playwright#43842 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/playwright
Issue simili
-
needs-area
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Azure/typespec-azure#5936 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
vercel-labs/scriptc#2910 ·
I maintainer di solito rispondono entro 1 giorno
-
automation missing-model model-sync provider:fireworks-ai
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/models.dev#12458 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno