github-advanced-security[bot] commented on code in PR #42253:
URL: https://github.com/apache/superset/pull/42253#discussion_r3618738303


##########
tests/unit_tests/utils/webdriver_test.py:
##########
@@ -750,18 +757,22 @@
 
         timeout = PlaywrightTimeout()
         mock_page.wait_for_function.side_effect = timeout
+        mock_page.evaluate.return_value = [
+            {"chartId": "42", "state": "nothing_mounted"}
+        ]
 
         with patch.object(WebDriverPlaywright, "auth", 
return_value=mock_context):
             driver = WebDriverPlaywright("chrome")
             with pytest.raises(PlaywrightTimeout) as exc_info:
                 driver.get_screenshot("http://example.com";, "test-element", 
mock_user)
 
         assert exc_info.value is timeout
-        mock_logger.warning.assert_any_call(
-            "Timed out waiting for charts to load at url %s 
(SCREENSHOT_LOAD_WAIT=%ss)",
-            "http://example.com";,
-            60,
-        )
+        mock_logger.error.assert_not_called()
+        warning_call = mock_logger.warning.call_args
+        assert "Timed out waiting for" in warning_call[0][0]
+        assert "http://example.com"; in warning_call[0]

Review Comment:
   ## CodeQL / Incomplete URL substring sanitization
   
   The string [http://example.com](1) may be at an arbitrary position in the 
sanitized URL.
   
   [Show more 
details](https://github.com/apache/superset/security/code-scanning/2584)



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