Skip to content

[screenshot] update wait times#6293

Open
beets wants to merge 1 commit into
datacommonsorg:masterfrom
beets:percy-snapshot-updates
Open

[screenshot] update wait times#6293
beets wants to merge 1 commit into
datacommonsorg:masterfrom
beets:percy-snapshot-updates

Conversation

@beets
Copy link
Copy Markdown
Collaborator

@beets beets commented May 18, 2026

Increased screenshot wait times
Removed ranking feature flag

@beets beets requested a review from nick-nlb May 18, 2026 21:47
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the reliability of the automated visual regression testing process by extending the page load timeout. It also simplifies the configuration for ranking page snapshots by removing an obsolete feature flag, ensuring the snapshots reflect the current production state.

Highlights

  • Increased Snapshot Wait Times: Updated the Percy snapshot script to increase the fallback and rendering wait times from 5 seconds to 60 seconds to ensure pages are fully loaded before capture.
  • Removed Feature Flag: Cleaned up the ranking URLs in the configuration file by removing the 'new_ranking_page' feature flag.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request increases the page load sleep time from 5 to 60 seconds in the Percy snapshot script and removes the disable_feature flag from ranking page URLs. Feedback suggests that the hard-coded 60-second sleep will significantly slow down the CI pipeline and recommends using dynamic waits or increasing the WAIT_TIMEOUT instead of a fixed sleep to improve efficiency.

from selenium.webdriver.support.ui import WebDriverWait

WAIT_TIMEOUT = 15
PAGE_LOAD_SECONDS = 60
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Increasing the hard sleep time to 60 seconds per page will significantly slow down the CI pipeline. Since shards process URLs sequentially (due to max_workers=1), this adds a minimum of 1 minute per URL. Consider using a more dynamic wait (e.g., WebDriverWait for a specific element that indicates the page is fully rendered) to improve efficiency.

f"[PID {os.getpid()}] Warning: Timed out waiting for primary element (body) on '{name}'. Proceeding with fallback sleep. ⏳"
)
time.sleep(5)
time.sleep(PAGE_LOAD_SECONDS)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

If the initial wait for the body element times out, it is unlikely that a 60-second sleep will result in a successful snapshot. If some pages are known to be slow, it would be more efficient to increase the WAIT_TIMEOUT so the script can proceed as soon as the element appears, rather than always waiting the full 60 seconds in the error path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant