Bug 1303668 - Retry downloading symbols if we're expecting them. draft
authorArmen Zambrano Gasparnian <armenzg@mozilla.com>
Mon, 03 Oct 2016 09:52:02 -0400
changeset 420143 d51e35a9f769df1c076d738aebb42d8bed2ebc88
parent 420017 955840bfd3c20eb24dd5a01be27bdc55c489a285
child 532734 62bf1d4d631d1e88e89c984047410ade2398de5c
push id31109
push userarmenzg@mozilla.com
push dateMon, 03 Oct 2016 14:28:36 +0000
bugs1303668
milestone52.0a1
Bug 1303668 - Retry downloading symbols if we're expecting them. In the case for 'ondemand' symbols, we're OK to proceed without getting a hold of the symbols from the get go. However, in other cases we need to at least retry before giving up (e.g. debug tests need symbols) MozReview-Commit-ID: 7LHflKhpze3
testing/mozharness/mozharness/mozilla/testing/testbase.py
--- a/testing/mozharness/mozharness/mozilla/testing/testbase.py
+++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py
@@ -501,26 +501,37 @@ 2. running via buildbot and running the 
                                             file_name=file_name,
                                             parent_dir=dirs['abs_work_dir'],
                                             error_level=FATAL)
         self.installer_path = os.path.realpath(source)
         self.set_buildbot_property("build_url", self.installer_url, write_to_file=True)
 
     def _download_and_extract_symbols(self):
         dirs = self.query_abs_dirs()
-        self.symbols_url = self.query_symbols_url()
         if self.config.get('download_symbols') == 'ondemand':
+            self.symbols_url = self.query_symbols_url()
             self.symbols_path = self.symbols_url
             return
-        if not self.symbols_path:
-            self.symbols_path = os.path.join(dirs['abs_work_dir'], 'symbols')
 
-        self.set_buildbot_property("symbols_url", self.symbols_url,
-                                   write_to_file=True)
-        self.download_unpack(self.symbols_url, self.symbols_path)
+        else:
+            # In the case for 'ondemand', we're OK to proceed without getting a hold of the
+            # symbols right this moment, however, in other cases we need to at least retry
+            # before being unable to proceed (e.g. debug tests need symbols)
+            self.symbols_url = self.retry(
+                action=self.query_symbols_url,
+                sleeptime=20,
+                error_level=FATAL,
+                error_message="We can't proceed without downloading symbols.",
+            )
+            if not self.symbols_path:
+                self.symbols_path = os.path.join(dirs['abs_work_dir'], 'symbols')
+
+            self.set_buildbot_property("symbols_url", self.symbols_url,
+                                       write_to_file=True)
+            self.download_unpack(self.symbols_url, self.symbols_path)
 
     def download_and_extract(self, extract_dirs=None, suite_categories=None):
         """
         download and extract test zip / download installer
         """
         # Swap plain http for https when we're downloading from ftp
         # See bug 957502 and friends
         from_ = "http://ftp.mozilla.org"