eschutho opened a new pull request, #42661: URL: https://github.com/apache/superset/pull/42661
### SUMMARY Follow-up to #42118, implementing @rebenitez1802's non-blocking review suggestion left at merge time (https://github.com/apache/superset/pull/42118#discussion — "tiled budget clock resets instead of accounting for pre-capture 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 `page.goto` (bounded 60s), the headstart sleep, `element.wait_for`, and dimension probing all ran before the clock started. The tile loop effectively got a fresh full budget on top of task time already spent. In the common case the 20%/300s cleanup margin absorbs the overhang (and a soft-limit overrun still surfaces as a clean `SoftTimeLimitExceeded`), but on **hard-limit-only tasks** the uncounted pre-capture time plus a full budget of tiled waits can still crest the hard limit — the SIGKILL #42118 exists to prevent. The non-tiled readiness wait already avoids this: #42427 threads `screenshot_started_at` from the top of `get_screenshot` into `_wait_for_charts_ready` and subtracts already-elapsed time. This PR applies exactly the same pattern to the tiled call — the three coordinated changes from the review suggestion: 1. `take_tiled_screenshot()` accepts `screenshot_started_at: float | None = None` and anchors the budget clock on it (falls back to "now" when omitted, preserving the existing API for any other caller); 2. `WebDriverPlaywright.get_screenshot()` passes its existing `screenshot_started_at` into the tiled call; 3. both capture paths now share one clock. ### TESTING INSTRUCTIONS ```bash pytest -q tests/unit_tests/utils/ # 732 passed ruff check / ruff format --check # clean ``` New tests: with `screenshot_started_at` provided, 900s of pre-capture elapsed time reduces the first tile's capped wait to the true remaining budget (100s of a 1000s budget, not the full `load_wait`); with it omitted, the local-clock default behaves exactly as before. The existing tiled call-site assertion now pins the new argument being forwarded. ### ADDITIONAL INFORMATION - [x] Has associated issue: follow-up to #42118; pattern from #42427 - [ ] 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]
