Bug 1305775 - Output more metadata about files fetched to increase debuggability. r=ted draft
authorArmen Zambrano Gasparnian <armenzg@mozilla.com>
Tue, 27 Sep 2016 13:37:18 -0400
changeset 418077 7b1ea32dcdc497831a387986d4449fffa37f54da
parent 417914 66a77b9bfe5dcacd50eccf85de7c0e7e15ce0ffd
child 532253 853f895cc302f941cf60ec849f4a7958b9a2ddee
push id30582
push userarmenzg@mozilla.com
push dateTue, 27 Sep 2016 17:38:04 +0000
reviewersted
bugs1305775, 1305752
milestone52.0a1
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
testing/mozharness/mozharness/base/script.py
--- 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)