From 4bcd2aad6caef00b5e28166901baa84a91c5c2c6 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Mon, 5 Aug 2024 17:04:22 -0400 Subject: [PATCH] core[patch]: Relax time constraints on rate limit test (#25071) Try to keep the unit test fast, but also have it repeat more robustly --- .../language_models/chat_models/test_rate_limiting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/tests/unit_tests/language_models/chat_models/test_rate_limiting.py b/libs/core/tests/unit_tests/language_models/chat_models/test_rate_limiting.py index b15b202f48..2d251aadb9 100644 --- a/libs/core/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +++ b/libs/core/tests/unit_tests/language_models/chat_models/test_rate_limiting.py @@ -84,7 +84,7 @@ def test_rate_limit_batch() -> None: toc = time.time() # Should be larger than check every n seconds since the token bucket starts # with 0 tokens. - assert time_to_fill < toc - tic < time_to_fill + 0.01 + assert time_to_fill < toc - tic < time_to_fill + 0.03 async def test_rate_limit_abatch() -> None: @@ -102,7 +102,7 @@ async def test_rate_limit_abatch() -> None: toc = time.time() # Should be larger than check every n seconds since the token bucket starts # with 0 tokens. - assert time_to_fill < toc - tic < time_to_fill + 0.01 + assert time_to_fill < toc - tic < time_to_fill + 0.03 def test_rate_limit_stream() -> None: