On Tue, Dec 10, 2013 at 12:52 AM, James Pic <james...@gmail.com> wrote:

> Hi all,
>
> I found that there was a hard coded 2 seconds limit in
> StoppableWSGIServer.shutdown:
> https://github.com/django/django/blob/1.6/django/test/testcases.py#L999
>
> This causes problems on slow boxes ie. travis:
> https://travis-ci.org/yourlabs/django-autocomplete-light/jobs/15177543
>
> Can we enable configurable wait time in shutdown() ?
>
> The we could use it like:
>
>     class WidgetTestCase(LiveServerTestCase)
>         shutdown_wait_time = 30 if os.environ.get('TRAVIS', False) else 2
>
> What do you think ?
>

Making this wait time configurable is certainly an option - however, is
there any reason that we shouldn't just increase the timeout value?

The 2 second value is a timeout limit -- it's a maximum value for waiting,
not a minimum. It's needed because a second thread needs to shut down, and
we need to wait until everything has stopped. If there's a common platform
where 2 seconds isn't enough delay (and Travis would count IMHO), then why
no just increase to something much bigger? In the "fast" case on good
hardware, nothing will change; the "slow" case on Travis et al will allow
for a graceful shutdown; and the genuine "its broken" case won't cause a
lockup -- it will just take a lot longer to die. Yes, this will be annoying
in the case of a problem, but not as annoying as false positives in a test
case. Hardware is only going to get faster with time, so a limit that is
big enough now is likely to stay that way.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAJxq849SaqnucUkRQY9FPwsUfR1m2U6u1D57r%3D0ZpfZF9TJ2-A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to