﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27596	LiveServerTestCase in 1.10.4 doesnt close server ports properly	Mike Hibbert	nobody	"I get the following error when using LiveServerTestCase along with lettuce:

Traceback (most recent call last):
  File ""./manage.py"", line 22, in <module>
    execute_from_command_line(sys.argv)
  File ""/home/mike/Documents/python/bdd_older/local/lib/python2.7/site-packages/django/core/management/__init__.py"", line 367, in execute_from_command_line
    utility.execute()
  File ""/home/mike/Documents/python/bdd_older/local/lib/python2.7/site-packages/django/core/management/__init__.py"", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/home/mike/Documents/python/bdd_older/local/lib/python2.7/site-packages/django/core/management/base.py"", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File ""/home/mike/Documents/python/bdd_older/local/lib/python2.7/site-packages/django/core/management/base.py"", line 345, in execute
    output = self.handle(*args, **options)
  File ""/home/mike/Documents/python/bdd_older/src/lettuce/lettuce/django/management/commands/harvest.py"", line 191, in handle
    server.start()
  File ""/home/mike/Documents/python/bdd_older/src/lettuce/lettuce/django/server.py"", line 350, in start
    LiveServerTestCase.setUpClass()
  File ""/home/mike/Documents/python/bdd_older/local/lib/python2.7/site-packages/django/test/testcases.py"", line 1353, in setUpClass
    raise cls.server_thread.error
socket.error: [Errno 98] Address already in use

To reproduce the bug I've attached my Django project that can be run.

The error occurs when you try to run the tests. The first time through it works fine but if you try and run the tests again with about 1 - 2mins it will give the error above.

When I downgrade to 1.9.4 this works fine without the error.
"	Bug	new	Testing framework	1.10	Normal				Unreviewed	0	0	0	0	0	0
