Skip to content
Snippets Groups Projects
Commit 60fb5063 authored by I. Nüske's avatar I. Nüske
Browse files

TST: Fix timeout reset in test_gitlab_com_127

parent ddaddb1c
No related branches found
No related tags found
1 merge request!86Add test for https://gitlab.com/linkahead/linkahead-pylib/-/issues/127
Pipeline #59081 passed
...@@ -207,10 +207,13 @@ def test_gitlab_com_127(): ...@@ -207,10 +207,13 @@ def test_gitlab_com_127():
See https://gitlab.com/linkahead/linkahead-pylib/-/issues/127 and See https://gitlab.com/linkahead/linkahead-pylib/-/issues/127 and
https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/93 https://gitlab.indiscale.com/caosdb/customers/f-fit/management/-/issues/93
""" """
# Setup paths # Setup paths and save previous timeout
base_dir = Path(__file__).parent.parent base_dir = Path(__file__).parent.parent
temp_pylinkahead_path = base_dir/'.pyla-temp-test.ini' temp_pylinkahead_path = base_dir/'.pyla-temp-test.ini'
temp_pylinkahead_path.unlink(True) temp_pylinkahead_path.unlink(True)
prev_timeout = None
if db.get_config().has_option('Connection', 'timeout'):
prev_timeout = db.get_config().get('Connection', 'timeout')
# Parse various timeout strings and check successful connect # Parse various timeout strings and check successful connect
valid_timeout_strings = ["timeout = None", "timeout=null", valid_timeout_strings = ["timeout = None", "timeout=null",
...@@ -231,4 +234,6 @@ def test_gitlab_com_127(): ...@@ -231,4 +234,6 @@ def test_gitlab_com_127():
# Reset configuration # Reset configuration
db.get_config().remove_option('Connection', 'timeout') db.get_config().remove_option('Connection', 'timeout')
if prev_timeout is not None:
db.get_config().set('Connection', 'timeout', prev_timeout)
db.configure_connection() db.configure_connection()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment