#21227: Selenium tests terminate with [Errno 10054] -----------------------------------+------------------------------------ Reporter: marfire | Owner: nobody Type: Bug | Status: new Component: Testing framework | Version: master Severity: Normal | Resolution: Keywords: selenium | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -----------------------------------+------------------------------------
Comment (by tkhyn): Hi, An attempt to mitigate this issue is in attached patch above. The only way to make it work is to Attempt to set server_thread.httpd.ignore_errors = True before calling WebDriver.quit() in the Selenium test case class's tearDownClass, like that: {{{ class MySeleniumTestCase(LiveServerTestCase) [...] @classmethod def tearDownClass(cls): if hasattr(cls, 'server_thread'): # test if server_thread attribute is available (as there may have been an exception in setUpClass) # setting ignore_errors flag on WSGI server thread to avoid unwanted 10054 cls.server_thread.httpd.ignore_errors = True cls.wd.quit() # cls.wd is the WebDriver instance super(LiveServerTestCase, cls).tearDownClass() }}} Could not find a simpler way to do it. Fully integrating it in Django would require a django-specific SeleniumTestCase class on top of LiveServerTestCase -- Ticket URL: <https://code.djangoproject.com/ticket/21227#comment:10> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.f3e73f3c36c0fc9f372ce09fce9b1cb5%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.