sources(curl): manually keep track of failed URLs

This commit keeps track of individual errors as curl will only report
the last download operation success/failure via it's exit code.

There is "--fail-early" but the downside of that is that abort all in
progress downloads too.
This commit is contained in:
Michael Vogt 2024-07-11 17:51:26 +02:00
parent a50dbb14c2
commit a229d46b1e
2 changed files with 16 additions and 8 deletions

View file

@ -102,7 +102,8 @@ def test_curl_download_many_fail(curl_parallel):
}
with pytest.raises(RuntimeError) as exp:
curl_parallel.fetch_all(TEST_SOURCES)
assert str(exp.value) == 'curl: error downloading http://localhost:9876/random-not-exists: error code 7'
assert str(exp.value).startswith("curl: error downloading http://localhost:9876/random-not-exists")
assert 'http://localhost:9876/random-not-exists: error code 7' in str(exp.value)
def make_test_sources(fake_httpd_root, port, n_files, start_n=0, cacert=""):