eschutho commented on code in PR #23290:
URL: https://github.com/apache/superset/pull/23290#discussion_r1130287974
##########
superset/utils/webdriver.py:
##########
@@ -176,22 +176,46 @@ def get_screenshot(
sleep(selenium_headstart)
try:
- logger.debug("Wait for the presence of %s", element_name)
- element = WebDriverWait(driver,
self._screenshot_locate_wait).until(
- EC.presence_of_element_located((By.CLASS_NAME, element_name))
- )
+ try:
+ # page didn't load
+ logger.debug(
+ "Wait for the presence of %s at url: %s", element_name, url
+ )
+ element = WebDriverWait(driver,
self._screenshot_locate_wait).until(
+ EC.presence_of_element_located((By.CLASS_NAME,
element_name))
+ )
+ except TimeoutException as ex:
+ logger.exception("Selenium timed out requesting url %s", url)
+ raise ex
- logger.debug("Wait for chart containers to draw")
- WebDriverWait(driver, self._screenshot_locate_wait).until(
- EC.visibility_of_all_elements_located(
- (By.CLASS_NAME, "slice_container")
+ try:
+ # chart containers didn't render
+ logger.debug("Wait for chart containers to draw at url: %s",
url)
+ WebDriverWait(driver, self._screenshot_locate_wait).until(
+ EC.visibility_of_all_elements_located(
+ (By.CLASS_NAME, "slice_container")
+ )
Review Comment:
These imo are going to be client errors, and will show as errors on the
dashboard when the user views it, not just in reports. This is an example where
the client db is down. Also dataset role access will show these errors. There's
a flag `SCREENSHOT_REPLACE_UNEXPECTED_ERRORS` to show better errors here in the
screenshots.

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]