Bug 1305775 - Output more metadata about files fetched to increase debuggability. r=ted
In
bug 1305752 we discovered that we download a zip file into memory without any issues, however,
when we tried to unzip we discovered that we have an invalid zip file.
The information in the logs is not sufficient to determine what could be the root issue.
MozReview-Commit-ID: DKwDUCmUhFF
--- a/testing/mozharness/mozharness/base/script.py
+++ b/testing/mozharness/mozharness/base/script.py
@@ -389,17 +389,19 @@ class ScriptMixin(PlatformMixin):
# Bug 1301807 - BadStatusLine: ''
response = urllib2.urlopen(request)
if parsed_url.scheme in ('http', 'https'):
expected_file_size = int(response.headers.get('Content-Length'))
self.info('Expected file size: {}'.format(expected_file_size))
self.debug('Url: {}'.format(url))
- self.debug('Content-Encoding {}'.format(response.headers.get('Content-Encoding')))
+ self.info('Content-Encoding {}'.format(response.headers.get('Content-Encoding')))
+ self.info('Content-Type {}'.format(response.headers.get('Content-Type')))
+ self.info('Http code {}'.format(response.getcode()))
file_contents = response.read()
obtained_file_size = len(file_contents)
if obtained_file_size != expected_file_size:
raise FetchedIncorrectFilesize(
'The expected file size is {} while we got instead {}'.format(
expected_file_size, obtained_file_size)