Streaming: when batch timeout fires, remaining tasks are cancelled.
()
| 599 | |
| 600 | @pytest.mark.asyncio |
| 601 | async def test_stream_batch_timeout_cancels_remaining(): |
| 602 | """Streaming: when batch timeout fires, remaining tasks are cancelled.""" |
| 603 | manager = SlowMockToolManager(delays={"fast_tool": 0.01, "slow_tool": 10.0}) |
| 604 | calls = [ |
| 605 | CTPToolCall(id="call_1", tool="fast_tool", arguments={}), |
| 606 | CTPToolCall(id="call_2", tool="slow_tool", arguments={}), |
| 607 | ] |
| 608 | |
| 609 | results = [] |
| 610 | async for result in stream_execute_tools(manager, calls, batch_timeout=0.5): |
| 611 | results.append(result) |
| 612 | |
| 613 | # fast_tool should have been yielded; slow_tool should have been cancelled |
| 614 | completed_tools = {r.tool for r in results} |
| 615 | assert "fast_tool" in completed_tools |
| 616 | assert "slow_tool" not in completed_tools |
| 617 | |
| 618 | |
| 619 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected