mirror of
https://github.com/bspeice/metrik
synced 2024-11-23 07:38:09 -05:00
Make the test a bit more lenient
If it's not 'fast' enough that's OK, we're mostly trying to make sure we don't go too fast
This commit is contained in:
parent
003a0024a0
commit
1375669888
@ -118,9 +118,9 @@ class RateLimitTest(MongoTest):
|
|||||||
end = datetime.now()
|
end = datetime.now()
|
||||||
# Check that we acquired the lock
|
# Check that we acquired the lock
|
||||||
assert did_acquire
|
assert did_acquire
|
||||||
# Check that we only used one backoff period
|
# Check that we used at least one backoff period
|
||||||
total_seconds = (end - start).total_seconds()
|
total_seconds = (end - start).total_seconds()
|
||||||
assert 1 < total_seconds < 2
|
assert 1 < total_seconds
|
||||||
|
|
||||||
def test_sleep_for_gives_correct_time(self):
|
def test_sleep_for_gives_correct_time(self):
|
||||||
ratelimit = MongoRateLimit()
|
ratelimit = MongoRateLimit()
|
||||||
|
Loading…
Reference in New Issue
Block a user