Skip to content

Fix flaky playwright tests#13049

Merged
freddyaboulton merged 12 commits intomainfrom
fix-flaky-tests
Mar 23, 2026
Merged

Fix flaky playwright tests#13049
freddyaboulton merged 12 commits intomainfrom
fix-flaky-tests

Conversation

@freddyaboulton
Copy link
Copy Markdown
Collaborator

@freddyaboulton freddyaboulton commented Mar 20, 2026

Description

Sometimes we see flakes in CI because playwright says no content is available on the page. The cause could be a race condition. We detect that the server is ready when the console prints "running on :" but it could be that the page is actually not ready yet. So this PR waits for both the node server and gradio server to be ready to accept HTTP requests before running the playwright tests.

AI Disclosure

We encourage the use of AI tooling in creating PRs, but the any non-trivial use of AI needs be disclosed. E.g. if you used Claude to write a first draft, you should mention that. Trivial tab-completion doesn't need to be disclosed. You should self-review all PRs, especially if they were generated with AI.

  • I used AI to investigate root case
  • I did not use AI

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Testing and Formatting Your Code

  1. PRs will only be merged if tests pass on CI. We recommend at least running the backend tests locally, please set up your Gradio environment locally and run the backed tests: bash scripts/run_backend_tests.sh

  2. Please run these bash scripts to automatically format your code: bash scripts/format_backend.sh, and (if you made any changes to non-Python files) bash scripts/format_frontend.sh

@freddyaboulton freddyaboulton added the v: patch A change that requires a patch release label Mar 20, 2026
@gradio-pr-bot
Copy link
Copy Markdown
Collaborator

gradio-pr-bot commented Mar 20, 2026

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/8b616dc0b7fb67cba98c1fef3b6b202c2c78f64b/gradio-6.9.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@8b616dc0b7fb67cba98c1fef3b6b202c2c78f64b#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/8b616dc0b7fb67cba98c1fef3b6b202c2c78f64b/gradio-client-2.1.0.tgz

@gradio-pr-bot
Copy link
Copy Markdown
Collaborator

gradio-pr-bot commented Mar 20, 2026

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@self/tootils patch
gradio patch

  • Fix flaky playwright tests

✅ Changeset approved by @freddyaboulton

  • Maintainers can remove approval by unchecking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@freddyaboulton freddyaboulton marked this pull request as ready for review March 23, 2026 20:05
Copy link
Copy Markdown
Contributor

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@freddyaboulton freddyaboulton merged commit 9ea8359 into main Mar 23, 2026
22 of 24 checks passed
@freddyaboulton freddyaboulton deleted the fix-flaky-tests branch March 23, 2026 20:36
@freddyaboulton
Copy link
Copy Markdown
Collaborator Author

Ty @aliabid94 !

freddyaboulton added a commit that referenced this pull request Mar 24, 2026
* Add code

* Add code

* add changeset

* empty

* revert

* Fix storage

* add changeset

* Try this

* trigger ci

* trigger-ci

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
freddyaboulton added a commit that referenced this pull request Mar 30, 2026
* Add implementation

* add changeset

* Add profiling.py

* remove unused function

* lint

* Avoid Polling in SSE Route To Reduce Overhead

* Fix flaky playwright tests (#13049)

* Add code

* Add code

* add changeset

* empty

* revert

* Fix storage

* add changeset

* Try this

* trigger ci

* trigger-ci

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* fix: gradio_api path in mount_gradio_app (#12803)

* fix: gradio_api path in mount_gradio_app

* Update js/core/src/init.svelte.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: add get_api_url unit test

---------

Co-authored-by: Zhang Xiaodong <zhangxiaodong1@sensetime.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <41651716+freddyaboulton@users.noreply.github.com>

* Add `watch` function to gr.HTML js_on_load (#12988)

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <41651716+freddyaboulton@users.noreply.github.com>

* Custom libraries in head of gr.HTML (#12990)

* changes

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

---------

Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <41651716+freddyaboulton@users.noreply.github.com>

* Modify API Visibility Docs (#13119)

* Modify API Visibility Docs

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Gradio Server Mode (#13117)

* changes

* add changeset

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* add changeset

* Update run.py

* changes

* changes

* changes

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* Backend Profiling: Ability to trace the server and benchmark scripts (#13032)

* Add implementation

* add changeset

* Add profiling.py

* remove unused function

* lint

* Add realistic apps

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>

* add changeset

* add changeset

* trigger ci

* Add code

* Use round-level timeout

* Finish remote runner

* chore: empty commit

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: shandowc <10107022+shandowc@users.noreply.github.com>
Co-authored-by: Zhang Xiaodong <zhangxiaodong1@sensetime.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: aliabid94 <aabid94@gmail.com>
Co-authored-by: Ali Abid <aliabid94@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: Abubakar Abid <islamrealm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v: patch A change that requires a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants