Files
superset2/tests/unit_tests/utils
Elizabeth Thompson 9536a28341 fix(reports): anchor tiled budget clock at overall screenshot start
Follow-up to #42118, implementing the non-blocking review suggestion
left at merge time: the tiled wait budget is derived from the running
Celery task's own time limit, but elapsed time was measured from a
clock started inside take_tiled_screenshot() -- so navigation
(page.goto, bounded 60s), the headstart sleep, element waits, and
dimension probing all ran before the clock started, effectively
granting the tile loop a fresh full budget on top of task time already
spent. On hard-limit-only tasks that overhang can still crest the task
limit -- the SIGKILL #42118 exists to prevent. The non-tiled readiness
wait already avoids this by threading screenshot_started_at from the
top of get_screenshot (#42427); this applies the same pattern to the
tiled call:

- take_tiled_screenshot() accepts screenshot_started_at (optional,
  defaults to "now" for backward compatibility) and anchors the budget
  clock on it;
- WebDriverPlaywright.get_screenshot() passes its existing
  screenshot_started_at into the tiled call, putting both capture paths
  on one clock.

Tests: pre-capture elapsed time reduces the first tile's capped wait
when the anchor is provided; the local-clock default is unchanged when
it is omitted; the existing tiled call-site assertion now pins the new
argument.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-31 22:44:12 +00:00
..