Title: [113271] trunk/Tools
Revision
113271
Author
[email protected]
Date
2012-04-04 18:17:13 -0700 (Wed, 04 Apr 2012)

Log Message

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.

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):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (113270 => 113271)


--- trunk/Tools/ChangeLog	2012-04-05 00:56:54 UTC (rev 113270)
+++ trunk/Tools/ChangeLog	2012-04-05 01:17:13 UTC (rev 113271)
@@ -5,7 +5,24 @@
 
         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  <[email protected]>
+
+        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):
         (FileUploader):

Modified: trunk/Tools/Scripts/webkitpy/common/net/file_uploader.py (113270 => 113271)


--- trunk/Tools/Scripts/webkitpy/common/net/file_uploader.py	2012-04-05 00:56:54 UTC (rev 113270)
+++ trunk/Tools/Scripts/webkitpy/common/net/file_uploader.py	2012-04-05 01:17:13 UTC (rev 113271)
@@ -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 @@
 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 @@
         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)

Modified: trunk/Tools/Scripts/webkitpy/common/net/networktransaction.py (113270 => 113271)


--- trunk/Tools/Scripts/webkitpy/common/net/networktransaction.py	2012-04-05 00:56:54 UTC (rev 113270)
+++ trunk/Tools/Scripts/webkitpy/common/net/networktransaction.py	2012-04-05 01:17:13 UTC (rev 113271)
@@ -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,7 +59,13 @@
                 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:
             raise NetworkTimeout()

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py (113270 => 113271)


--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py	2012-04-05 00:56:54 UTC (rev 113270)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py	2012-04-05 01:17:13 UTC (rev 113271)
@@ -320,7 +320,10 @@
         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
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to