From fae57533273f9d3c79817c946cf33a8408bb9669 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 31 Jul 2024 11:40:00 +0200 Subject: [PATCH] Revert "sources(curl): disable `curl --parallel` by default" This reverts commit 9bef57d5a6bf5f64f811ec09b2c7a97697b47a84. --- sources/org.osbuild.curl | 6 ------ sources/test/test_curl_source.py | 13 ++----------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/sources/org.osbuild.curl b/sources/org.osbuild.curl index 638657643..4bcd96fa5 100755 --- a/sources/org.osbuild.curl +++ b/sources/org.osbuild.curl @@ -110,12 +110,6 @@ def curl_has_parallel_downloads(): Return true if curl has all the support we needed for parallel downloading (this include --write-out "%{json}" too """ - # Re-enable this once the failures in - # https://github.com/osbuild/osbuild-composer/pull/4247 - # are understood - if os.getenv("OSBUILD_SOURCES_CURL_USE_PARALLEL") not in ["1", "yes", "true"]: - return False - output = subprocess.check_output(["curl", "--version"], universal_newlines=True) first_line = output.split("\n", maxsplit=1)[0] m = re.match(r'^curl (\d+\.\d+\.\d+)', first_line) diff --git a/sources/test/test_curl_source.py b/sources/test/test_curl_source.py index f90479cf6..f5b5862a6 100644 --- a/sources/test/test_curl_source.py +++ b/sources/test/test_curl_source.py @@ -170,9 +170,7 @@ def test_curl_download_many_chksum_validate(tmp_path, curl_parallel): @pytest.mark.parametrize("curl_parallel", [True, False], indirect=["curl_parallel"]) -def test_curl_download_many_retries(tmp_path, monkeypatch, curl_parallel): - monkeypatch.setenv("OSBUILD_SOURCES_CURL_USE_PARALLEL", "1") - +def test_curl_download_many_retries(tmp_path, curl_parallel): fake_httpd_root = tmp_path / "fake-httpd-root" with http_serve_directory(fake_httpd_root) as httpd: @@ -352,14 +350,7 @@ def test_curl_gen_download_config_parallel(tmp_path, sources_module): @patch("subprocess.check_output") -def test_curl_has_parallel_download(mocked_check_output, monkeypatch, sources_module): - # by default, --parallel is disabled - mocked_check_output.return_value = NEW_CURL_OUTPUT - assert not sources_module.curl_has_parallel_downloads() - - # unless this environemnt is set - monkeypatch.setenv("OSBUILD_SOURCES_CURL_USE_PARALLEL", "1") - +def test_curl_has_parallel_download(mocked_check_output, sources_module): mocked_check_output.return_value = NEW_CURL_OUTPUT assert sources_module.curl_has_parallel_downloads()