Bug 1256300 - Add timeout to mozharness urllib2.urlopen call. r=jlund, a=test-only
authorGeoff Brown <gbrown@mozilla.com>
Thu, 12 May 2016 08:55:00 -0600
changeset 333226 53d94e77fd504839e52e67318f01c802ff3d7cf2
parent 333225 1dd7b155900eb230dcbbf6e08441f565e60686f6
child 333227 fed4ae5b589496361a7bcbf8c2f11ce658d17c50
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund, test-only
Bug 1256300 - Add timeout to mozharness urllib2.urlopen call. r=jlund, a=test-only
--- a/testing/mozharness/mozharness/mozilla/testing/testbase.py
+++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py
@@ -7,16 +7,17 @@
 import copy
 import os
 import platform
 import pprint
 import re
 import urllib2
 import json
+import socket
 from mozharness.base.errors import BaseErrorList
 from mozharness.base.log import FATAL, WARNING
 from mozharness.base.python import (
@@ -191,21 +192,20 @@ class TestingMixin(VirtualenvMixin, Buil
             return self.symbols_url
         elif self.installer_url:
             symbols_url = self.query_prefixed_build_dir_url('.crashreporter-symbols.zip')
             # Check if the URL exists. If not, use none to allow mozcrash to auto-check for symbols
                 if symbols_url:
-                    self._urlopen(symbols_url)
+                    self._urlopen(symbols_url, timeout=120)
                     self.symbols_url = symbols_url
-            except urllib2.URLError:
-                self.warning("Can't figure out symbols_url from installer_url: %s!" %
-                             self.installer_url)
+            except (urllib2.URLError, socket.error, socket.timeout):
+                self.exception("Can't figure out symbols_url from installer_url: %s!" % self.installer_url, level=WARNING)
         # If no symbols URL can be determined let minidump_stackwalk query the symbols.
         # As of now this only works for Nightly and release builds.
         if not self.symbols_url:
             self.warning("No symbols_url found. Let minidump_stackwalk query for symbols.")
         return self.symbols_url