#27596: LiveServerTestCase in 1.10.4 doesnt close server ports properly
-----------------------------------+--------------------------------------
     Reporter:  Mike Hibbert       |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Testing framework  |                  Version:  1.10
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------
Description changed by Mike Hibbert:

Old 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.

New 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.

 Here's my code to reproduce the bug, the upload restrictions stopped me
 adding an attachment but you can see my test case here
 ​https://www.dropbox.com/s/18uy88gz6frjyeg/bdd_app.tar.gz?dl=0

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27596#comment:2>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.22cb6727a0fa0028ae1343ddcc1538e0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to