SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix(tests): deflake SSO login tests — wait until the browser has left the idp after keycloak login (#12399)
Tushar Vats58c21637a171
diff --git a/tests/fixtures/idp.py b/tests/fixtures/idp.pyindex 9a6e926634..50e5b67aba 100644--- a/tests/fixtures/idp.py+++ b/tests/fixtures/idp.py@@ -7,6 +7,7 @@ import pytestimport requestsfrom keycloak import KeycloakAdminfrom selenium import webdriver+from selenium.common.exceptions import WebDriverExceptionfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support import expected_conditions as ECfrom selenium.webdriver.support.wait import WebDriverWait@@ -370,11 +371,20 @@ def idp_login(driver: webdriver.Chrome) -> Callable[[str, str], None]:password_field.send_keys(password)# Click the login button+ idp_host = urlparse(driver.current_url).netloclogin_button = wait.until(EC.element_to_be_clickable((By.ID, "kc-login")))login_button.click()- # Wait till kc-login element has vanished from the page, which means that a redirection is taking place.- wait.until(EC.invisibility_of_element((By.ID, "kc-login")))+ # Wait till the browser has left the idp host — not just the login page: keycloak's SAML flow inserts an+ # auto-submitting interstitial on the idp whose POST is what creates the user in signoz. The button is+ # re-queried per poll; a mid-navigation WebDriverException (detached node) just retries the poll.+ def _left_idp(drv: webdriver.Chrome) -> bool:+ try:+ return urlparse(drv.current_url).netloc != idp_host and not drv.find_elements(By.ID, "kc-login")+ except WebDriverException:+ return False++ wait.until(_left_idp)return _idp_login