From d9166a6d97f259c378046622e0596fa7ceecbc2c Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 20 Jun 2024 10:55:47 -0700 Subject: [PATCH] test(test_alangfuse.py): fix race condition --- litellm/tests/test_alangfuse.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/tests/test_alangfuse.py b/litellm/tests/test_alangfuse.py index fa560fa498..9e83991c58 100644 --- a/litellm/tests/test_alangfuse.py +++ b/litellm/tests/test_alangfuse.py @@ -362,8 +362,9 @@ async def test_aaalangfuse_logging_metadata(langfuse_client): print(response) metadata["existing_trace_id"] = trace_id - langfuse_client.flush() # make sure traces w/ generations are flushed in-order, prevents race condition of trace output being overwritten - await asyncio.sleep(10) + await asyncio.sleep(2) + langfuse_client.flush() + # await asyncio.sleep(10) # Tests the metadata filtering and the override of the output to be the last generation for trace_id, generation_ids in trace_identifiers.items():