Skip to content

Commit 3ee4ce5

Browse files
authored
test: loop until result on A2A tests (#2953)
1 parent 0974d5f commit 3ee4ce5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_a2a.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ async def test_a2a_pydantic_model_output():
8686
task_id = result['id']
8787

8888
# Wait for completion
89-
await anyio.sleep(0.1)
90-
task = await a2a_client.get_task(task_id)
91-
92-
assert 'result' in task
93-
result = task['result']
94-
assert result['status']['state'] == 'completed'
89+
while task := await a2a_client.get_task(task_id): # pragma: no branch
90+
if 'result' in task and task['result']['status']['state'] == 'completed':
91+
result = task['result']
92+
break
93+
await anyio.sleep(0.1)
9594

9695
# Check artifacts
9796
assert 'artifacts' in result
@@ -198,6 +197,7 @@ async def test_a2a_simple():
198197
if 'result' in task and task['result']['status']['state'] == 'completed':
199198
break
200199
await anyio.sleep(0.1)
200+
201201
assert task == snapshot(
202202
{
203203
'jsonrpc': '2.0',

0 commit comments

Comments
 (0)