()
| 890 | |
| 891 | def tearDown(self): |
| 892 | def stop_server(): |
| 893 | self.server.stop() |
| 894 | # Delay the shutdown of the IOLoop by several iterations because |
| 895 | # the server may still have some cleanup work left when |
| 896 | # the client finishes with the response (this is noticeable |
| 897 | # with http/2, which leaves a Future with an unexamined |
| 898 | # StreamClosedError on the loop). |
| 899 | |
| 900 | @gen.coroutine |
| 901 | def slow_stop(): |
| 902 | yield self.server.close_all_connections() |
| 903 | # The number of iterations is difficult to predict. Typically, |
| 904 | # one is sufficient, although sometimes it needs more. |
| 905 | for i in range(5): |
| 906 | yield |
| 907 | self.server_ioloop.stop() |
| 908 | |
| 909 | self.server_ioloop.add_callback(slow_stop) |
| 910 | |
| 911 | self.server_ioloop.add_callback(stop_server) |
| 912 | self.server_thread.join() |
nothing calls this directly
no test coverage detected