Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Allow more time for cascade initialization (#11250)

Trevor Manzb2bdb3f6a8c0
diff --git a/tests/_server/host/drive.py b/tests/_server/host/drive.py
index d589a15837..c22b247a40 100644
--- a/tests/_server/host/drive.py
+++ b/tests/_server/host/drive.py
@@ -143,7 +143,24 @@ async def wait_for(
while not condition(response):
remaining = deadline - asyncio.get_running_loop().time()
if remaining <= 0:
- raise TimeoutError(f"gave up waiting; saw {response.names()}")
+ lifecycles = [
+ {
+ "event": record["event"],
+ **{
+ key: value
+ for key, value in record["data"][
+ record["event"]
+ ].items()
+ if key in {"id", "run_id", "cell_id", "status"}
+ },
+ }
+ for record in response.records
+ if record.get("event") in {"run", "execution"}
+ ]
+ raise TimeoutError(
+ f"gave up waiting after {timeout}s; saw {response.names()}; "
+ f"lifecycle events: {lifecycles}"
+ )
response.changed.clear()
try:
await asyncio.wait_for(response.changed.wait(), remaining)
diff --git a/tests/_server/host/test_host_execution.py b/tests/_server/host/test_host_execution.py
index 44f461b67c..1160412cd3 100644
--- a/tests/_server/host/test_host_execution.py
+++ b/tests/_server/host/test_host_execution.py
@@ -464,6 +464,8 @@ async def initialize_cascade(app: Starlette, events: Response) -> None:
r.get("data", {}).get("run", {}).get("status") == "completed"
for r in response.records
),
+ # Initial widget imports and construction can be slow on CI.
+ timeout=15,
)
runs = [
r["data"]["run"] for r in events.records if r.get("event") == "run"