Opened 8 years ago
Last modified 8 years ago
#27596 closed Bug
LiveServerTestCase in 1.10.4 doesnt close server ports properly — at Initial Version
Reported by: | Mike Hibbert | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | Marten Kenbeek | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.