-
Notifications
You must be signed in to change notification settings - Fork 0
Fix Playwright test timeouts on CI by using deterministic load waits #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: deploy-twice-a-day
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hasparus <15332326+hasparus@users.noreply.github.com>
|
well @copilot |
Co-authored-by: hasparus <15332326+hasparus@users.noreply.github.com>
I've replaced
The issue was that |
It seems unlikely that this is the case @copilot. There seems to be something else wrong. |
Co-authored-by: hasparus <15332326+hasparus@users.noreply.github.com>
You're absolutely right. I investigated further and found the real issue in commit f989e45: The problem was using I've replaced it with The tests now simply:
This should be much more reliable on CI. |
Description
Playwright tests were passing locally but failing on CI due to timeout issues when running against production builds (
pnpm startvspnpm dev).Root Cause
The tests were using
waitUntil: "networkidle"which waits for NO network activity for 500ms straight. If the page has continuous polling, analytics, third-party scripts, or any periodic network requests,networkidlemay never trigger or take extremely long, causing tests to timeout unpredictably on CI.Changes
test/e2e/community-events.spec.ts
networkidletoloadwaitUntil strategy for deterministic page load waitingscrollIntoViewIfNeeded()calls (not needed - sections are server-rendered)playwright.config.ts
Example
The
loadstrategy is more reliable because it waits for DOMContentLoaded and all resources to finish loading, which is a deterministic event that will always occur, unlikenetworkidlewhich requires complete network silence.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.