diff --git a/docs/config_reference.rst b/docs/config_reference.rst index f7930d3d5b..223a4f3e46 100644 --- a/docs/config_reference.rst +++ b/docs/config_reference.rst @@ -1257,12 +1257,12 @@ General Configuration The command-line option sets the configuration option to ``false``. -.. js:attribute:: .general[].git_clone_timeout +.. js:attribute:: .general[].git_timeout :required: No :default: 5 - Timeout value in seconds that will be used while cloning git repositories. + Timeout value in seconds used when checking if a git repository exists. .. js:attribute:: .general[].remote_detect diff --git a/docs/manpage.rst b/docs/manpage.rst index fde8e3fcdb..e8d1055357 100644 --- a/docs/manpage.rst +++ b/docs/manpage.rst @@ -760,16 +760,16 @@ Here is an alphabetical list of the environment variables recognized by ReFrame: ================================== ================== -.. envvar:: RFM_GIT_CLONE_TIMEOUT +.. envvar:: RFM_GIT_TIMEOUT - Timeout in seconds for the ``git clone`` commands. + Timeout value in seconds used when checking if a git repository exists. .. table:: :align: left ================================== ================== Associated command line option N/A - Associated configuration parameter :js:attr:`git_clone_timeout` general configuration parameter. + Associated configuration parameter :js:attr:`git_timeout` general configuration parameter. ================================== ================== diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 065db88545..b9347c041e 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1296,7 +1296,7 @@ def _clone_to_stagedir(self, url): self.logger.debug(f'Cloning URL {url} into stage directory') osext.git_clone( self.sourcesdir, self._stagedir, - timeout=rt.runtime().get_option('general/0/git_clone_timeout') + timeout=rt.runtime().get_option('general/0/git_timeout') ) @final diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 538af97314..de6a167d8b 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -461,10 +461,11 @@ def main(): # Options not associated with command-line arguments argparser.add_argument( - dest='git_clone_timeout', - envvar='RFM_GIT_CLONE_TIMEOUT', - configvar='general/git_clone_timeout', - help='Timeout in seconds of git clone commands' + dest='git_timeout', + envvar='RFM_GIT_TIMEOUT', + configvar='general/git_timeout', + help=('Timeout in seconds when checking if the url is a ' + 'valid repository.') ) argparser.add_argument( dest='graylog_server', diff --git a/reframe/schemas/config.json b/reframe/schemas/config.json index 75b6c34f65..8f7c21a99a 100644 --- a/reframe/schemas/config.json +++ b/reframe/schemas/config.json @@ -452,7 +452,7 @@ "check_search_recursive": {"type": "boolean"}, "clean_stagedir": {"type": "boolean"}, "colorize": {"type": "boolean"}, - "git_clone_timeout": {"type": "number"}, + "git_timeout": {"type": "number"}, "ignore_check_conflicts": {"type": "boolean"}, "trap_job_errors": {"type": "boolean"}, "keep_stage_files": {"type": "boolean"}, @@ -498,7 +498,7 @@ "general/check_search_recursive": false, "general/clean_stagedir": true, "general/colorize": true, - "general/git_clone_timeout": 5, + "general/git_timeout": 5, "general/ignore_check_conflicts": false, "general/trap_job_errors": false, "general/keep_stage_files": false, diff --git a/reframe/utility/osext.py b/reframe/utility/osext.py index 69f7b74bd3..6c1894b1f1 100644 --- a/reframe/utility/osext.py +++ b/reframe/utility/osext.py @@ -419,7 +419,8 @@ def git_clone(url, targetdir=None, timeout=5): '''Clone a git repository from a URL. :arg url: The URL to clone from. - :arg timeout: Timeout in seconds. + :arg timeout: Timeout in seconds when checking if the url is a valid + repository. :arg targetdir: The directory where the repository will be cloned to. If :class:`None`, a new directory will be created with the repository name as if ``git clone {url}`` was issued. @@ -428,8 +429,7 @@ def git_clone(url, targetdir=None, timeout=5): raise ReframeError('git repository does not exist') targetdir = targetdir or '' - run_command(f'git clone {url} {targetdir}', check=True, - timeout=timeout) + run_command(f'git clone {url} {targetdir}', check=True) def git_repo_exists(url, timeout=5): diff --git a/unittests/test_config.py b/unittests/test_config.py index 55d6a438ed..45b5f90f1a 100644 --- a/unittests/test_config.py +++ b/unittests/test_config.py @@ -304,7 +304,7 @@ def test_select_subconfig_optional_section_absent(): site_config = config.load_config('reframe/core/settings.py') site_config.select_subconfig() assert site_config.get('general/0/colorize') is True - assert site_config.get('general/0/git_clone_timeout') == 5 + assert site_config.get('general/0/git_timeout') == 5 assert site_config.get('general/verbose') == 0