nrwt is failing to upload test results on the chromium-mac-leopard bots
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 01:17:13 +0000 (01:17 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 01:17:13 +0000 (01:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83230

Reviewed by Ojan Vafai.

More debugging info and a possible fix - stop messing with the
default network timeout, and don't swallow URLErrors.

* Scripts/webkitpy/common/net/file_uploader.py:
(FileUploader._upload_data):
* Scripts/webkitpy/common/net/networktransaction.py:
(NetworkTransaction.run):
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
(JSONResultsGeneratorBase.upload_json_files):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113271 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/net/file_uploader.py
Tools/Scripts/webkitpy/common/net/networktransaction.py
Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py

index dc744df..4c11556 100644 (file)
@@ -5,6 +5,23 @@
 
         Reviewed by Ojan Vafai.
 
+        More debugging info and a possible fix - stop messing with the
+        default network timeout, and don't swallow URLErrors.
+
+        * Scripts/webkitpy/common/net/file_uploader.py:
+        (FileUploader._upload_data):
+        * Scripts/webkitpy/common/net/networktransaction.py:
+        (NetworkTransaction.run):
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        (JSONResultsGeneratorBase.upload_json_files):
+
+2012-04-04  Dirk Pranke  <dpranke@chromium.org>
+
+        nrwt is failing to upload test results on the chromium-mac-leopard bots
+        https://bugs.webkit.org/show_bug.cgi?id=83230
+
+        Reviewed by Ojan Vafai.
+
         * Scripts/webkitpy/common/net/file_uploader.py:
         (FileUploader.__init__):
         (FileUploader._upload_data.callback):
index b8587eb..3b88b99 100644 (file)
@@ -28,6 +28,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 import codecs
+import logging
 import mimetypes
 import socket
 import urllib2
@@ -35,6 +36,9 @@ import urllib2
 from webkitpy.common.net.networktransaction import NetworkTransaction
 
 
+_log = logging.getLogger(__name__)
+
+
 def get_mime_type(filename):
     return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
 
@@ -112,8 +116,10 @@ class FileUploader(object):
         response = None
         try:
             # FIXME: We shouldn't mutate global static state.
-            socket.setdefaulttimeout(self._timeout_seconds)
-            response = NetworkTransaction(timeout_seconds=self._timeout_seconds).run(callback)
+            # FIXME: clean this up once we understand what's going on on chromium leopard bots.
+            if not self._debug:
+                socket.setdefaulttimeout(self._timeout_seconds)
+            return NetworkTransaction(timeout_seconds=self._timeout_seconds).run(callback)
         finally:
-            socket.setdefaulttimeout(orig_timeout)
-            return response
+            if not self._debug:
+                socket.setdefaulttimeout(orig_timeout)
index c77989b..6576c1d 100644 (file)
@@ -1,9 +1,9 @@
 # Copyright (C) 2010 Google Inc. All rights reserved.
-# 
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
-# 
+#
 #     * Redistributions of source code must retain the above copyright
 # notice, this list of conditions and the following disclaimer.
 #     * Redistributions in binary form must reproduce the above
@@ -13,7 +13,7 @@
 #     * Neither the name of Google Inc. nor the names of its
 # contributors may be used to endorse or promote products derived from
 # this software without specific prior written permission.
-# 
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -59,6 +59,12 @@ class NetworkTransaction(object):
                 self._check_for_timeout()
                 _log.warn("Received HTTP status %s loading \"%s\".  Retrying in %s seconds..." % (e.code, e.filename, self._backoff_seconds))
                 self._sleep()
+            except urllib2.URLError, e:
+                # FIXME: urllib2 seems to convert socket errors to this.
+                self._check_for_timeout()
+                _log.warn("Received URLError %s.  Retrying in %s seconds..." % (str(s), self._backoff_seconds))
+                self._sleep()
+
 
     def _check_for_timeout(self):
         if self._total_sleep + self._backoff_seconds > self._timeout_seconds:
index 1c2b0e2..0cf0554 100644 (file)
@@ -320,7 +320,10 @@ class JSONResultsGeneratorBase(object):
         uploader = FileUploader(url, 120, debug=True)
         try:
             response = uploader.upload_as_multipart_form_data(self._filesystem, files, attrs)
-            _log.debug("Upload returned %d: '%s'" % (response.code, response.read()))
+            if response:
+                _log.debug("Upload returned %d: '%s'" % (response.code, response.read()))
+            else:
+                _log.debug("Upload returned None")
         except Exception, err:
             _log.error("Upload failed: %s" % err)
             return