eschutho opened a new pull request, #39895:
URL: https://github.com/apache/superset/pull/39895
### SUMMARY
Follow-up to #39579. After that fix landed, a review identified additional
issues:
1. **Viewport-aware global spinner check** (`webdriver.py`) — The global
`wait_for_function` checked `document.querySelectorAll('.loading').length ===
0`, which deadlocks on tall dashboards when `DashboardVirtualization` renders
off-screen placeholder `.loading` divs. Changed to a `getBoundingClientRect`
viewport-visibility check — the same approach already used in the per-tile path.
2. **Narrow exception handling** (`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** — `take_tiled_screenshot`'s `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 long dashboard (more than one viewport height
of charts) and verify no loading 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]