Title: [255500] trunk/Tools
Revision
255500
Author
[email protected]
Date
2020-01-31 09:12:45 -0800 (Fri, 31 Jan 2020)

Log Message

results.webkit.org: Handle modified firewall rules
https://bugs.webkit.org/show_bug.cgi?id=207047

Reviewed by Aakash Jain.

* Scripts/webkitpy/results/upload.py:
(Upload.upload_archive): Return true for 403 and 413 errors, but print a message
indicating the upload failed.
* Scripts/webkitpy/results/upload_unittest.py:
(UploadTest.test_archive_upload):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (255499 => 255500)


--- trunk/Tools/ChangeLog	2020-01-31 17:07:15 UTC (rev 255499)
+++ trunk/Tools/ChangeLog	2020-01-31 17:12:45 UTC (rev 255500)
@@ -1,3 +1,16 @@
+2020-01-31  Jonathan Bedard  <[email protected]>
+
+        results.webkit.org: Handle modified firewall rules
+        https://bugs.webkit.org/show_bug.cgi?id=207047
+
+        Reviewed by Aakash Jain.
+
+        * Scripts/webkitpy/results/upload.py:
+        (Upload.upload_archive): Return true for 403 and 413 errors, but print a message
+        indicating the upload failed.
+        * Scripts/webkitpy/results/upload_unittest.py:
+        (UploadTest.test_archive_upload):
+
 2020-01-30  Jiewen Tan  <[email protected]>
 
         Unreviewed, another speculative test fix after r255041

Modified: trunk/Tools/Scripts/webkitpy/results/upload.py (255499 => 255500)


--- trunk/Tools/Scripts/webkitpy/results/upload.py	2020-01-31 17:07:15 UTC (rev 255499)
+++ trunk/Tools/Scripts/webkitpy/results/upload.py	2020-01-31 17:12:45 UTC (rev 255500)
@@ -233,7 +233,7 @@
             return False
 
         # FIXME: <rdar://problem/56154412> do not fail test runs because of 403 errors
-        if response.status_code not in [200, 403]:
+        if response.status_code not in [200, 403, 413]:
             log_line_func(' ' * 4 + 'Error uploading archive to {}'.format(hostname))
             try:
                 log_line_func(' ' * 8 + response.json().get('description'))
@@ -242,5 +242,14 @@
                     log_line_func(' ' * 8 + line)
             return False
 
-        log_line_func(' ' * 4 + 'Uploaded test archive to {}'.format(hostname))
+        if response.status_code == 200:
+            log_line_func(' ' * 4 + 'Uploaded test archive to {}'.format(hostname))
+        else:
+            log_line_func(' ' * 4 + 'Upload to {} failed:'.format(hostname))
+            try:
+                log_line_func(' ' * 8 + response.json().get('description'))
+            except ValueError:
+                for line in response.text.splitlines():
+                    log_line_func(' ' * 8 + line)
+            log_line_func(' ' * 4 + 'This error is not fatal, continuing')
         return True

Modified: trunk/Tools/Scripts/webkitpy/results/upload_unittest.py (255499 => 255500)


--- trunk/Tools/Scripts/webkitpy/results/upload_unittest.py	2020-01-31 17:07:15 UTC (rev 255499)
+++ trunk/Tools/Scripts/webkitpy/results/upload_unittest.py	2020-01-31 17:12:45 UTC (rev 255500)
@@ -250,3 +250,16 @@
                 ' ' * 4 + 'Error uploading archive to https://results.webkit.org',
                 ' ' * 8 + 'No such address',
             ], lines)
+
+        mock_413 = mock.patch('requests.post', new=lambda url, headers={}, data="" files={}, verify=True: self.MockResponse(
+            status_code=413,
+            text=json.dumps(dict(description='Request Entity Too Large')),
+        ))
+        with mock_413:
+            lines = []
+            self.assertTrue(upload.upload_archive('https://results.webkit.org', archive='content', log_line_func=lambda line: lines.append(line)))
+            self.assertEqual([
+                ' ' * 4 + 'Upload to https://results.webkit.org failed:',
+                ' ' * 8 + 'Request Entity Too Large',
+                ' ' * 4 + 'This error is not fatal, continuing',
+            ], lines)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to