Fix and improve test speed
This commit is contained in:
@@ -55,7 +55,7 @@ class QPSService:
|
||||
|
||||
def retry(self, first_request_time, retry_count):
|
||||
elapsed = datetime.now() - first_request_time
|
||||
if elapsed.seconds > self._retry_timeout:
|
||||
if elapsed.microseconds > (self._retry_timeout * 1000.0):
|
||||
raise TimeoutException()
|
||||
|
||||
# inverse qps * (1.5 ^ i) is an increased sleep time of 1.5x per
|
||||
|
||||
@@ -16,7 +16,7 @@ class TestQPS(TestCase):
|
||||
|
||||
def test_qps_timeout(self, req_mock):
|
||||
class TestClass:
|
||||
@qps_retry(timeout=1)
|
||||
@qps_retry(timeout=0.001, qps=100)
|
||||
def test(self):
|
||||
response = requests.get('http://localhost/test_qps')
|
||||
if response.status_code == 429:
|
||||
|
||||
Reference in New Issue
Block a user