test: unflake har-websocket timing assertions - #42126
Conversation
- tolerate 100ms clock skew between browser-reported wall times and Date.now() (flaked on Windows bots only, where the browser clock and the Node clock can disagree at the millisecond level) - allow the recorded websocket duration to slightly under-run the nominal setTimeout delays - report zero HAR entry duration instead of -1 when all websocket frames share a single coarse-clock timestamp
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| expect(wsEntry.time).toBeGreaterThanOrEqual(delayMs * (incomingCount + outgoingCount)); | ||
| // setTimeout may fire marginally early and browser-reported timestamps are | ||
| // coarse on some platforms, so the measured span can under-run the nominal delays. | ||
| expect(wsEntry.time).toBeGreaterThanOrEqual(delayMs * (incomingCount + outgoingCount) - clockSkewMs); |
There was a problem hiding this comment.
i think we may need to just drop this check as it has failed with
883mshttps://github.com/microsoft/playwright/actions/runs/29845176099/job/88683834325607mshttps://github.com/microsoft/playwright/actions/runs/29329966412/job/870752848411061mshttps://github.com/microsoft/playwright/actions/runs/29314574075/job/87025605804
so the 100ms is not good enough
|
Hi, I'm the Playwright bot and I took a first look at the CI failures here. 🟢 CI is clear — the failures don't come from this PRThis is a test-only change to the HAR websocket timing assertions ( DetailsOverall: the diff only changes HAR websocket duration reporting and its test. The Pre-existing flake / infra
I'm a first pass, not the final word — but I'd merge on the CI signal here. Triaged by the Playwright bot - agent run |
Test results for "tests 1"8 flaky51191 passed, 1188 skipped Merge workflow run. |
Test results for "MCP"8050 passed, 1284 skipped Merge workflow run. |
Summary
Date.now()— flaked exclusively on Windows bots, where the browser's monotonic-based wall-time estimate and Node's clock disagree at the millisecond levelsetTimeoutdelays