Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/unit/test_sdk_set_coalescer.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,14 @@ async def test_flush_sets_sends_the_gathered_batch_now(agent: Agent) -> None:
assert sum(1 for r in results if r.get("coalesced")) == 3


async def test_close_flushes_before_the_pool_closes(agent: Agent) -> None:
async def test_close_flushes_before_the_pool_closes(
agent: Agent, monkeypatch: pytest.MonkeyPatch
) -> None:
from tests.unit.clock_fake import ManualClock

loop = asyncio.get_running_loop()
clock = ManualClock(t=loop.time())
monkeypatch.setattr(loop, "time", clock.monotonic)
t: Any = agent.transport
tasks = [asyncio.ensure_future(agent.memory.set(f"k{i}", i)) for i in range(4)]
await asyncio.sleep(0)
Expand Down
Loading