Skip to content

Commit

Permalink
make rate limit tests less strict
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Dec 15, 2024
1 parent 3e6118f commit b510882
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/extract/test_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,9 @@ def rate_limited_resource():
if rate_limit is None:
assert elapsed < 0.1
elif rate_limit == 10:
assert elapsed > 1.0 and elapsed < 2.0
assert (elapsed > 1.0) and (elapsed < 3.0)
elif rate_limit == 100:
assert elapsed > 0.1 and elapsed < 0.3
assert (elapsed > 0.1) and (elapsed < 0.6)

# run another check with a source and transformer
# here we check that rate limit also works with multiple resources and on transformers
Expand All @@ -940,9 +940,9 @@ def infinite_source():
if rate_limit is None:
assert elapsed < 0.1
elif rate_limit == 10:
assert elapsed > 2.5 and elapsed < 4.0
assert (elapsed > 2.5) and (elapsed < 5.0)
elif rate_limit == 100:
assert elapsed > 0.2 and elapsed < 1.0
assert (elapsed > 0.2) and (elapsed < 1.0)

try:
del os.environ["EXTRACT__RATE_LIMIT"]
Expand Down

0 comments on commit b510882

Please sign in to comment.