bito-code-review[bot] commented on PR #42624:
URL: https://github.com/apache/superset/pull/42624#issuecomment-5148916243
<!-- Bito Reply -->
The flagged issue is correct. The Selenium `screenshot` command does not
inherently respect the page load timeout, and without an explicit timeout
parameter, it can block indefinitely, potentially exceeding the report's
execution budget. The PR already addresses this by introducing a bounded
capture mechanism using `_timeout_seconds` to calculate a `capture_timeout` and
passing it to `page.screenshot`.
To resolve this, ensure the `page.screenshot` call uses the calculated
timeout as shown in the diff:
```python
capture_timeout = (
_timeout_seconds(
"screenshot_capture",
reserve_seconds=(
report_execution_context.post_capture_reserve_seconds
if report_execution_context
else 0.0
),
)
if report_execution_context or task_budget is not None
else None
)
tile_screenshot = page.screenshot(
type="png",
clip=clip,
**(
{"timeout": capture_timeout * 1000}
if capture_timeout is not None
else {}
),
)
```
Would you like me to fetch all other comments on this PR to validate and
implement fixes for them as well?
**superset/utils/webdriver.py**
```
capture_timeout = (
_timeout_seconds(
"screenshot_capture",
reserve_seconds=(
report_execution_context.post_capture_reserve_seconds
if report_execution_context
else 0.0
),
)
if report_execution_context or task_budget is not None
else None
)
tile_screenshot = page.screenshot(
type="png",
clip=clip,
**(
{"timeout": capture_timeout * 1000}
if capture_timeout is not None
else {}
),
)
```
--
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]