sadpandajoe commented on code in PR #44114:
URL: https://github.com/apache/superset/pull/44114#discussion_r3975425263


##########
superset/utils/screenshot_utils.py:
##########
@@ -487,6 +488,35 @@ def _unready_chart_holders_js_body(*, viewport_only: bool) 
-> str:
     f"() => {{ {UNREADY_ALL_CHART_HOLDERS_JS_BODY} "
     "return holders.length > 0 && unready.length === 0; }"
 )
+
+
+def _stable_readiness_js(readiness_predicate: str) -> str:
+    """Require a readiness predicate to remain true for a capture dwell."""
+
+    return f"""
+    args => {{
+        const ready = ({readiness_predicate})();
+        const now = performance.now();
+        const previous = window.__supersetCaptureReadiness;
+        if (!ready) {{
+            window.__supersetCaptureReadiness = {{token: args.token, since: 
null}};

Review Comment:
   The new tests stub `wait_for_function`, so none executes this reset/dwell 
state machine; replacing the comparison with `return true` or removing this 
reset still leaves them green and reopens the exact ready → loading race. Could 
we add a browser/JS-level regression that drives ready → loading → ready and 
asserts a fresh 500 ms dwell before capture?



##########
.github/actions/setup-backend/action.yml:
##########
@@ -43,6 +43,8 @@ runs:
       if: inputs.install-superset == 'true'
       uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # 
v9.0.0
       with:
+        # Avoid a network-dependent lookup of the latest uv version during 
setup.
+        version: "0.12.12"

Review Comment:
   Pinning this version still leaves the same manifest request on every 
tool-cache miss: setup-uv resolves the artifact through `getArtifact()` → 
`findManifestVersion()` → the remote `uv.ndjson`, so a timeout to that endpoint 
still fails backend setup before tests. Should this use an install path or 
local manifest that actually removes that lookup?



-- 
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]

Reply via email to