Companion to the previous commit's positive per-tile readiness check,
carrying the rest of PR #42119's changes onto this base:
- Per-tile readiness timeout logs at WARNING (customer chart-loading
issue, not a system fault -- matching #38130/#38441) with elapsed wait
time, tile index/total, load_wait, and the identity + stuck-state of
each unready chart holder (waiting_on_database / spinner_mounted /
nothing_mounted), then re-raises so the report fails rather than
shipping a blank or spinner tile. A per-tile DEBUG line logs readiness
wait time for profiling.
- The deliberate readiness-timeout re-raise is tracked with an explicit
flag rather than `except PlaywrightTimeout` at the outer level, since
PlaywrightTimeout is aliased to bare Exception when playwright isn't
installed and would otherwise swallow-or-propagate the wrong cases.
- Threads an optional log_context (e.g. "execution_id=<uuid>") from
BaseReportState._get_screenshots through BaseScreenshot.get_screenshot
and both WebDriverProxy implementations into take_tiled_screenshot,
so timeout logs correlate back to the report run. Defaults to None
for callers outside the report pipeline (thumbnails).
Backported from apache/superset#42119 (commits 37da786b52, f6feb70eca,
97d15485ad squashed) onto this branch's base; only the log lines this
change itself adds or touches carry the context suffix -- pre-existing
log lines on this base (f-string style) are left as-is.
Co-Authored-By: Claude <noreply@anthropic.com>
`take_tiled_screenshot()` waited for the *absence* of `.loading` elements
visible in the viewport before capturing each tile. With
DashboardVirtualization on (default), a chart holder that has just scrolled
into view but hasn't fired its IntersectionObserver callback yet mounts
neither a spinner nor a chart, so the predicate passed vacuously and the
tile was captured blank. On top of that, a per-tile timeout was caught,
logged as a warning, and the tile was captured anyway -- delivering a
spinner screenshot to report recipients instead of failing the report.
Replace the absence-of-`.loading` predicate with a positive readiness
check: every chart holder (`data-test="dashboard-component-chart-holder"`)
intersecting the viewport must show a terminal state (a rendered chart via
`.slice_container`, or an error/empty state via `[role="alert"]` /
`.ant-empty` / `.missing-chart-container`) before a tile is captured. A
holder with nothing mounted no longer satisfies the wait.
A per-tile timeout is now logged at ERROR with the tile index, the
load_wait, and the identities of the still-unready chart holders, and
re-raises instead of being swallowed -- the report now fails
(ReportScheduleScreenshotFailedError) instead of silently shipping a
degraded screenshot.
Co-Authored-By: Claude <noreply@anthropic.com>
Cherry-picked from master commit 459b4cb23d
Accepted:
- Bounded \s+ to \s{1,5} and \s* to \s{0,5} in time_range_lookup regexes
- Added tests for bounded whitespace validation
Adapted:
- Preserved 6.0-release "first/1st of" patterns between modified sections
- Kept existing tests for "first of" expressions
Original author: Jean Massucatto <massucattoj@gmail.com>