Use fresh worker caches for async batch predictions

This commit is contained in:
Andras Schmelczer 2026-10-27 16:52:00 +00:00
commit 8de675f3a5

View file

@ -58,6 +58,20 @@ def test_http_preserves_nested_models(isolated_context: None, is_async: bool) ->
assert response.json()["output"] == 5
@pytest.mark.asyncio
async def test_batch_after_async_prediction(isolated_context: None) -> None:
@GreatAI.create
async def predict(value: int) -> int:
return value + 1
assert (await predict(1)).output == 2
assert [trace.output for trace in predict.process_batch([1, 2], concurrency=1)] == [
2,
3,
]
assert (await predict(1)).output == 2
def test_flattening_preserves_reserved_trace_fields() -> None:
trace = Trace(
trace_id="actual-id",