Skip to content

Commit 5b49930

Browse files
committed
Do not re-run, just wait for startup to fininsh
1 parent b22c33c commit 5b49930

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/services/kernels/test_execution_state.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
MINIMUM_CONSISTENT_COUNT = 4
1818

1919

20-
@pytest.mark.flaky(max_runs=5)
20+
@pytest.mark.flaky
2121
async def test_execution_state(jp_fetch, jp_ws_fetch):
2222
r = await jp_fetch("api", "kernels", method="POST", allow_nonstandard_methods=True)
2323
kernel = json.loads(r.body.decode())
@@ -53,6 +53,17 @@ async def test_execution_state(jp_fetch, jp_ws_fetch):
5353
)
5454
await poll_for_parent_message_status(kid, message_id, "busy", ws)
5555
es = await get_execution_state(kid, jp_fetch)
56+
57+
# kernels start slowly on Windows
58+
max_startup_time = 60
59+
started = time.time()
60+
while es == "starting":
61+
await asyncio.sleep(1)
62+
elapsed = time.time() - started
63+
if elapsed > max_startup_time:
64+
raise ValueError(f"Kernel did not start up in {max_startup_time} seconds")
65+
es = await get_execution_state(kid, jp_fetch)
66+
5667
assert es == "busy"
5768

5869
message_id_2 = uuid.uuid1().hex

0 commit comments

Comments
 (0)