Bug 1483589 [wpt PR 12505] - [HTTP/2.0] Extra safety checks to fix crash during test, a=testonly
authorDavid H <dhdavvie@gmail.com>
Thu, 16 Aug 2018 21:55:56 +0000
changeset 487253 3377bf83184a7362747793d4aaaf43f0767c75d6
parent 487252 b5aab38ab9085bd97d841f636478c9ba7842b06f
child 487254 35dd99779ab6446f629d53bc363e90ebfff4d79c
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1483589, 12505
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1483589 [wpt PR 12505] - [HTTP/2.0] Extra safety checks to fix crash during test, a=testonly Automatic update from web-platform-testsAdded extra checks for safety, and catch any unexpected exceptions (#12505) -- wpt-commits: a23e7d3d7df1817e2ef05de695349c8ba3b405a6 wpt-pr: 12505
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/tools/wptserve/wptserve/server.py
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -643049,17 +643049,17 @@
    "5118c03b728313f703f6e9002c4003fc0d6e1d98",
    "support"
   ],
   "tools/wptserve/wptserve/routes.py": [
    "b6e3800018a5b6d3db167457daf6fa90affa44f8",
    "support"
   ],
   "tools/wptserve/wptserve/server.py": [
-   "353835ee84f2bbe0c36837cddad6794de11b7fa8",
+   "8370cca0d3872f5e9f0fe65a40049b5c4065cb91",
    "support"
   ],
   "tools/wptserve/wptserve/sslutils/__init__.py": [
    "6699edb5964530e7e352497de43ff1e154b52a1d",
    "support"
   ],
   "tools/wptserve/wptserve/sslutils/base.py": [
    "c95b693f37123178c33f93125e7d8df46899db3c",
--- a/testing/web-platform/tests/tools/wptserve/wptserve/server.py
+++ b/testing/web-platform/tests/tools/wptserve/wptserve/server.py
@@ -364,27 +364,29 @@ class Http2WebTestRequestHandler(BaseWeb
                             queue.put(frame)
 
                     elif hasattr(frame, 'stream_id'):
                         if frame.stream_id not in stream_queues:
                             queue = Queue()
                             stream_queues[frame.stream_id] = (self.start_stream_thread(frame, queue), queue)
                         stream_queues[frame.stream_id][1].put(frame)
 
-                        if isinstance(frame, StreamEnded) or frame.stream_ended:
+                        if isinstance(frame, StreamEnded) or (hasattr(frame, "stream_ended") and frame.stream_ended):
                             del stream_queues[frame.stream_id]
 
         except (socket.timeout, socket.error) as e:
-            self.logger.debug('(%s) ERROR - Closing Connection - \n%s' % (self.uid, str(e)))
+            self.logger.error('(%s) Closing Connection - \n%s' % (self.uid, str(e)))
             if not self.close_connection:
                 self.close_connection = True
                 for stream_id, (thread, queue) in stream_queues.items():
                     queue.put(None)
+        except Exception as e:
+            self.logger.error('(%s) Unexpected Error - \n%s' % (self.uid, str(e)))
         finally:
-            for stream_id, (thread, queue) in stream_queues:
+            for stream_id, (thread, queue) in stream_queues.items():
                 thread.join()
 
     def start_stream_thread(self, frame, queue):
         t = threading.Thread(
             target=Http2WebTestRequestHandler._stream_thread,
             args=(self, frame.stream_id, queue)
         )
         t.start()
@@ -435,17 +437,18 @@ class Http2WebTestRequestHandler(BaseWeb
                     req_handler.handle_data(frame, request, response)
 
                 if frame.stream_ended:
                     wfile.close()
             elif frame is None or isinstance(frame, (StreamReset, StreamEnded, ConnectionTerminated)):
                 self.logger.debug('(%s - %s) Stream Reset, Thread Closing' % (self.uid, stream_id))
                 break
 
-            request.frames.append(frame)
+            if request is not None:
+                request.frames.append(frame)
 
             if hasattr(frame, "stream_ended") and frame.stream_ended:
                 self.finish_handling(request, response, req_handler)
 
     def frame_handler(self, request, response, handler):
         try:
             return handler.frame_handler(request)
         except HTTPException as e: