[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
eric at webkit.org
eric at webkit.org
Wed Dec 22 14:46:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 8606625f25373dc64f2a6a8df74141b42d21b3d0
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 19 23:02:49 2010 +0000
2010-10-19 Eric Seidel <eric at webkit.org>
Unreviewed, just fixing test-webkitpy. I'm really on a roll today.
commit-queue gets stuck when release-patch returns 404
https://bugs.webkit.org/show_bug.cgi?id=47935
Fix test-webkitpy and unittest NetworkTransaction.
* Scripts/webkitpy/common/net/networktransaction.py:
* Scripts/webkitpy/common/net/networktransaction_unittest.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index d6e7fa7..f7ba536 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,17 @@
2010-10-19 Eric Seidel <eric at webkit.org>
+ Unreviewed, just fixing test-webkitpy. I'm really on a roll today.
+
+ commit-queue gets stuck when release-patch returns 404
+ https://bugs.webkit.org/show_bug.cgi?id=47935
+
+ Fix test-webkitpy and unittest NetworkTransaction.
+
+ * Scripts/webkitpy/common/net/networktransaction.py:
+ * Scripts/webkitpy/common/net/networktransaction_unittest.py:
+
+2010-10-19 Eric Seidel <eric at webkit.org>
+
Unreviewed.
commit-queue gets stuck when release-patch returns 404
diff --git a/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
index 04c158f..de19e94 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
@@ -45,6 +45,7 @@ class NetworkTransaction(object):
self._initial_backoff_seconds = initial_backoff_seconds
self._grown_factor = grown_factor
self._timeout_seconds = timeout_seconds
+ self._convert_404_to_None = convert_404_to_None
def run(self, request):
self._total_sleep = 0
@@ -54,7 +55,7 @@ class NetworkTransaction(object):
return request()
# FIXME: We should catch urllib2.HTTPError here too.
except mechanize.HTTPError, e:
- if convert_404_to_None and e.code == 404:
+ if self._convert_404_to_None and e.code == 404:
return None
self._check_for_timeout()
_log.warn("Received HTTP status %s from server. Retrying in "
diff --git a/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
index cd0702b..49aaeed 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
@@ -56,29 +56,36 @@ class NetworkTransactionTest(LoggingTestCase):
self.assertTrue(did_throw_exception)
self.assertTrue(did_process_exception)
- def _raise_http_error(self):
+ def _raise_500_error(self):
self._run_count += 1
if self._run_count < 3:
- raise HTTPError("http://example.com/", 500, "inteneral server error", None, None)
+ raise HTTPError("http://example.com/", 500, "internal server error", None, None)
return 42
+ def _raise_404_error(self):
+ raise HTTPError("http://foo.com/", 404, "not found", None, None)
+
def test_retry(self):
self._run_count = 0
transaction = NetworkTransaction(initial_backoff_seconds=0)
- self.assertEqual(transaction.run(lambda: self._raise_http_error()), 42)
+ self.assertEqual(transaction.run(lambda: self._raise_500_error()), 42)
self.assertEqual(self._run_count, 3)
self.assertLog(['WARNING: Received HTTP status 500 from server. '
'Retrying in 0 seconds...\n',
'WARNING: Received HTTP status 500 from server. '
'Retrying in 0.0 seconds...\n'])
+ def test_convert_404_to_None(self):
+ transaction = NetworkTransaction(convert_404_to_None=True)
+ self.assertEqual(transaction.run(lambda: self._raise_404_error()), None)
+
def test_timeout(self):
self._run_count = 0
transaction = NetworkTransaction(initial_backoff_seconds=60*60, timeout_seconds=60)
did_process_exception = False
did_throw_exception = True
try:
- transaction.run(lambda: self._raise_http_error())
+ transaction.run(lambda: self._raise_500_error())
did_throw_exception = False
except NetworkTimeout, e:
did_process_exception = True
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list