Commit 6d244adc authored by David Mendez's avatar David Mendez
Browse files

test limiting to only 1 per day

parent 06395c9b
......@@ -42,6 +42,7 @@ def create_app():
with flask_app.app_context():
DB.init_app(flask_app)
CACHE.init_app(flask_app)
RATE_LIMITER.init_app(flask_app)
create_tables = RUN_CONFIG.get('sql_alchemy').get('create_tables', False)
if create_tables:
......@@ -57,8 +58,6 @@ def create_app():
flask_app.register_blueprint(ADMIN_AUTH_BLUEPRINT, url_prefix=f'{base_path}/admin')
flask_app.register_blueprint(ADMIN_TASKS_BLUEPRINT, url_prefix=f'{base_path}/admin')
RATE_LIMITER.init_app(flask_app)
return flask_app
if __name__ == '__main__':
......
......@@ -4,9 +4,9 @@ Module that defines the instance of the rate limiter
from flask_limiter import Limiter
from flask_limiter.util import get_ipaddr
PER_SECOND = 2
PER_SECOND = 0.5
RATE_LIMITER = Limiter(
key_func=get_ipaddr,
default_limits=[f'{PER_SECOND*60*60*24} per day', f'{PER_SECOND*60*60} per hour']
default_limits=['1 per day']
)
\ No newline at end of file
......@@ -61,7 +61,7 @@ def run_test(server_base_url, admin_username, admin_password):
job_id = submit_response.get('job_id')
print('Wait a bit again until it finishes')
time.sleep(10)
time.sleep(20)
utils.assert_job_status_with_retries(status_url, 'FINISHED')
status_url = utils.get_status_url(server_base_url, job_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment