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

Fix transiently failing tool shed tests. #2030

Merged
merged 1 commit into from Mar 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 5 additions & 12 deletions test/tool_shed/base/twilltestcase.py
Expand Up @@ -540,26 +540,19 @@ def expect_repo_created_strings( self, name ):
'Repository <b>%s</b> has been created' % name,
]

def export_capsule( self, repository, aggressive=False, includes_dependencies=None ):
def export_capsule( self, repository, aggressive=True, includes_dependencies=None ):
# TODO: Remove this method and restore _exort_capsule as export_capsule
# after transient problem is fixed.
if not aggressive:
return self._export_capsule(repository, includes_dependencies=includes_dependencies)
else:
try:
return self._export_capsule(repository, includes_dependencies=includes_dependencies)
except Exception as original_error:
except Exception:
# Empirically this fails occasionally, we don't know
# why however.
time.sleep(1)
capsule_filename = None
try:
capsule_filename = self._export_capsule( repository )
except Exception:
pass
if capsule_filename is None:
log.info("Tried and retried to export capsule - this is a known issue with the test case - the test will fail.")
raise original_error
else:
raise Exception("Transient problem with export capsule test would be fixed with a sleep and retry")
return self._export_capsule( repository, includes_dependencies=includes_dependencies)

def _export_capsule( self, repository, includes_dependencies=None ):
url = '/repository/export?repository_id=%s&changeset_revision=%s' % \
Expand Down