]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Delay shutdown of the IOLoop in sync HTTPClient test.
authorBen Darnell <ben@bendarnell.com>
Sun, 19 Apr 2015 02:54:31 +0000 (22:54 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 19 Apr 2015 02:54:31 +0000 (22:54 -0400)
This appears to cause spurious logs in HTTP/2 tests.

tornado/test/httpclient_test.py

index abc220ba42cfb7cea1917be4f9ecb15b6ec9f837..ecc63e4a49e50f1a685c1ad247978a089c2de8e0 100644 (file)
@@ -550,7 +550,12 @@ class SyncHTTPClientTest(unittest.TestCase):
     def tearDown(self):
         def stop_server():
             self.server.stop()
-            self.server_ioloop.stop()
+            # Delay the shutdown of the IOLoop by one iteration because
+            # the server may still have some cleanup work left when
+            # the client finishes with the response (this is noticable
+            # with http/2, which leaves a Future with an unexamined
+            # StreamClosedError on the loop).
+            self.server_ioloop.add_callback(self.server_ioloop.stop)
         self.server_ioloop.add_callback(stop_server)
         self.server_thread.join()
         self.http_client.close()