()
| 793 | |
| 794 | def tearDown(self): |
| 795 | def stop_server(): |
| 796 | self.server.stop() |
| 797 | # Delay the shutdown of the IOLoop by several iterations because |
| 798 | # the server may still have some cleanup work left when |
| 799 | # the client finishes with the response (this is noticeable |
| 800 | # with http/2, which leaves a Future with an unexamined |
| 801 | # StreamClosedError on the loop). |
| 802 | |
| 803 | @gen.coroutine |
| 804 | def slow_stop(): |
| 805 | yield self.server.close_all_connections() |
| 806 | # The number of iterations is difficult to predict. Typically, |
| 807 | # one is sufficient, although sometimes it needs more. |
| 808 | for i in range(5): |
| 809 | yield |
| 810 | self.server_ioloop.stop() |
| 811 | |
| 812 | self.server_ioloop.add_callback(slow_stop) |
| 813 | |
| 814 | self.server_ioloop.add_callback(stop_server) |
| 815 | self.server_thread.join() |
nothing calls this directly
no test coverage detected