Title: [261000] trunk/Tools
Revision
261000
Author
jbed...@apple.com
Date
2020-05-01 08:34:33 -0700 (Fri, 01 May 2020)

Log Message

results.webkit.org: Dropped connections when uploading archives shouldn't be fatal
https://bugs.webkit.org/show_bug.cgi?id=211248

Rubber-stamped by Aakash Jain.

* Scripts/webkitpy/results/upload.py:
(Upload.upload_archive): Dropping a connection when uploading archives shouldn't
be a fatal error.
* Scripts/webkitpy/results/upload_unittest.py:
(UploadTest.test_archive_upload):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (260999 => 261000)


--- trunk/Tools/ChangeLog	2020-05-01 14:52:01 UTC (rev 260999)
+++ trunk/Tools/ChangeLog	2020-05-01 15:34:33 UTC (rev 261000)
@@ -1,3 +1,16 @@
+2020-05-01  Jonathan Bedard  <jbed...@apple.com>
+
+        results.webkit.org: Dropped connections when uploading archives shouldn't be fatal
+        https://bugs.webkit.org/show_bug.cgi?id=211248
+
+        Rubber-stamped by Aakash Jain.
+
+        * Scripts/webkitpy/results/upload.py:
+        (Upload.upload_archive): Dropping a connection when uploading archives shouldn't
+        be a fatal error.
+        * Scripts/webkitpy/results/upload_unittest.py:
+        (UploadTest.test_archive_upload):
+
 2020-05-01  Lauro Moura  <lmo...@igalia.com>
 
         [Flatpak SDK] Honor XDG_RUNTIME_DIR when setting the document path

Modified: trunk/Tools/Scripts/webkitpy/results/upload.py (260999 => 261000)


--- trunk/Tools/Scripts/webkitpy/results/upload.py	2020-05-01 14:52:01 UTC (rev 260999)
+++ trunk/Tools/Scripts/webkitpy/results/upload.py	2020-05-01 15:34:33 UTC (rev 261000)
@@ -22,6 +22,7 @@
 
 import webkitpy.thirdparty.autoinstalled.requests
 
+import math
 import os
 import json
 import requests
@@ -224,8 +225,13 @@
             )
 
         except requests.exceptions.ConnectionError:
-            log_line_func(' ' * 4 + 'Failed to upload test archive to {}, results server not online'.format(hostname))
-            return False
+            archive.seek(0, os.SEEK_END)
+            log_line_func(' ' * 4 + 'Failed to upload test archive to {}, results server dropped connection, likely due to archive size ({} MB).'.format(
+                hostname,
+                math.floor(float(archive.tell()) / 1024) / 1024,
+            ))
+            log_line_func(' ' * 4 + 'This error is not fatal, continuing')
+            return True
         except ValueError as e:
             log_line_func(' ' * 4 + 'Failed to encode archive reference data: {}'.format(e))
             return False

Modified: trunk/Tools/Scripts/webkitpy/results/upload_unittest.py (260999 => 261000)


--- trunk/Tools/Scripts/webkitpy/results/upload_unittest.py	2020-05-01 14:52:01 UTC (rev 260999)
+++ trunk/Tools/Scripts/webkitpy/results/upload_unittest.py	2020-05-01 15:34:33 UTC (rev 261000)
@@ -31,6 +31,7 @@
 
 from webkitpy.results.upload import Upload
 from webkitpy.thirdparty import mock
+from webkitpy.common.unicode_compatibility import BytesIO
 
 if sys.version_info > (3, 0):
     basestring = str
@@ -232,12 +233,15 @@
         )
 
         with mock.patch('requests.post', new=lambda url, headers={}, data="" files={}, verify=True: self.MockResponse()):
-            self.assertTrue(upload.upload_archive('https://results.webkit.org', archive='content', log_line_func=lambda _: None))
+            self.assertTrue(upload.upload_archive('https://results.webkit.org', archive=BytesIO(b'content'), log_line_func=lambda _: None))
 
         with mock.patch('requests.post', new=lambda url, headers={}, data="" files={}, verify=True: self.raise_requests_ConnectionError()):
             lines = []
-            self.assertFalse(upload.upload_archive('https://results.webkit.org', archive='content', log_line_func=lambda line: lines.append(line)))
-            self.assertEqual([' ' * 4 + 'Failed to upload test archive to https://results.webkit.org, results server not online'], lines)
+            self.assertTrue(upload.upload_archive('https://results.webkit.org', archive=BytesIO(b'content'), log_line_func=lambda line: lines.append(line)))
+            self.assertEqual([
+                ' ' * 4 + 'Failed to upload test archive to https://results.webkit.org, results server dropped connection, likely due to archive size (0.0 MB).',
+                ' ' * 4 + 'This error is not fatal, continuing'
+            ], lines)
 
         mock_404 = mock.patch('requests.post', new=lambda url, headers={}, data="" files={}, verify=True: self.MockResponse(
             status_code=404,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to