Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't retry when NotFoundException #3562

Merged
merged 1 commit into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conans/client/rest/uploader_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ def call_with_retry(out, retry, retry_wait, method, *args, **kwargs):
for counter in range(retry):
try:
return method(*args, **kwargs)
except NotFoundException:
raise
except ConanException as exc:
if counter == (retry - 1):
raise
Expand Down
15 changes: 15 additions & 0 deletions conans/test/functional/download_retries_test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import unittest

from conans import API_V2
from conans.paths import CONANFILE
from conans.test.utils.tools import TestClient, TestServer


class DownloadRetriesTest(unittest.TestCase):

def test_do_not_retry_when_missing_file(self):

test_server = TestServer(server_capabilities=[API_V2])
client = TestClient(servers={"default": test_server},
users={"default": [("lasote", "mypass")]})
conanfile = '''from conans import ConanFile
class MyConanfile(ConanFile):
pass
'''
client.save({CONANFILE: conanfile})
client.run("create . Pkg/0.1@lasote/stable")
client.run("upload '*' -c --all")
self.assertEquals(str(client.out).count("seconds to retry..."), 0)

def test_recipe_download_retry(self):
test_server = TestServer()
client = TestClient(servers={"default": test_server},
Expand Down