eschutho opened a new pull request, #39892:
URL: https://github.com/apache/superset/pull/39892
### SUMMARY
Follow-up to #39579. The first fix addressed the snapshot-based spinner
detection in `webdriver.py`. This PR addresses additional issues identified
during review:
1. **Viewport-aware global spinner check** — The global `wait_for_function`
in `webdriver.py` previously checked
`document.querySelectorAll('.loading').length === 0`, which can deadlock on
tall dashboards when `DashboardVirtualization` renders off-screen placeholder
`.loading` divs. Changed to the same `getBoundingClientRect`
viewport-visibility check used in the per-tile path.
2. **Narrow exception handling in `screenshot_utils.py`** — The per-tile
spinner wait caught bare `Exception`, silently swallowing non-timeout errors
(e.g. browser crash). Narrowed to `PlaywrightTimeout` with a runtime-safe
conditional import (same try/except import pattern as `webdriver.py`).
3. **Fix `load_wait` default** — The `take_tiled_screenshot` `load_wait`
parameter defaulted to 30 s, inconsistent with the `SCREENSHOT_LOAD_WAIT`
config default of 60 s.
4. **Tests** — Added tests for the per-tile spinner wait: viewport JS check,
timeout warning + continue, non-timeout propagation, and the `load_wait`
default value. Updated existing webdriver test to match the new viewport-aware
JS.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend logic change only.
### TESTING INSTRUCTIONS
1. Run `pytest tests/unit_tests/utils/test_screenshot_utils.py
tests/unit_tests/utils/webdriver_test.py`
2. Trigger a PDF report for a dashboard taller than the viewport (several
rows of charts) and verify no spinners appear in the output PDF.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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]