mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 22:37:46 +00:00
core[patch]: Relax time constraints on rate limit test (#25071)
Try to keep the unit test fast, but also have it repeat more robustly
This commit is contained in:
@@ -84,7 +84,7 @@ def test_rate_limit_batch() -> None:
|
|||||||
toc = time.time()
|
toc = time.time()
|
||||||
# Should be larger than check every n seconds since the token bucket starts
|
# Should be larger than check every n seconds since the token bucket starts
|
||||||
# with 0 tokens.
|
# 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:
|
async def test_rate_limit_abatch() -> None:
|
||||||
@@ -102,7 +102,7 @@ async def test_rate_limit_abatch() -> None:
|
|||||||
toc = time.time()
|
toc = time.time()
|
||||||
# Should be larger than check every n seconds since the token bucket starts
|
# Should be larger than check every n seconds since the token bucket starts
|
||||||
# with 0 tokens.
|
# 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:
|
def test_rate_limit_stream() -> None:
|
||||||
|
Reference in New Issue
Block a user