From 41e55ab6989c0ae39d03de87895aa27da49eaeea Mon Sep 17 00:00:00 2001 From: Mohataseem Khan Date: Sat, 10 Jan 2026 21:25:09 +0530 Subject: [PATCH 1/2] Increase retry attempts and add timeout for server check Increased the retry attempts for server connection and added a timeout to the HTTP request. --- scripts/playwright/sql_databases/image02.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/playwright/sql_databases/image02.py b/scripts/playwright/sql_databases/image02.py index 6c4f685e86..7a606329f4 100644 --- a/scripts/playwright/sql_databases/image02.py +++ b/scripts/playwright/sql_databases/image02.py @@ -25,12 +25,16 @@ process = subprocess.Popen( ["fastapi", "run", "docs_src/sql_databases/tutorial002.py"], ) try: - for _ in range(3): + for _ in range(10): try: - response = httpx.get("http://localhost:8000/docs") + response = httpx.get("http://localhost:8000/docs", timeout=1) + if response.status_code == 200: + break except httpx.ConnectError: time.sleep(1) - break + else: + raise RuntimeError("Server did not start in time") + with sync_playwright() as playwright: run(playwright) finally: From 1aa466e8e28e049efdb676e1bb1beb453529faef Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sat, 10 Jan 2026 15:57:26 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/playwright/sql_databases/image02.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/playwright/sql_databases/image02.py b/scripts/playwright/sql_databases/image02.py index 7a606329f4..8cab09e689 100644 --- a/scripts/playwright/sql_databases/image02.py +++ b/scripts/playwright/sql_databases/image02.py @@ -34,7 +34,7 @@ try: time.sleep(1) else: raise RuntimeError("Server did not start in time") - + with sync_playwright() as playwright: run(playwright) finally: