mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Edited testing.txt changes from [17289]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17307 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
32ee74f89e
commit
ffb0519d44
@ -1781,8 +1781,7 @@ via the :djadminopt:`--liveserver` option, for example:
|
||||
|
||||
Another way of changing the default server address is by setting the
|
||||
`DJANGO_LIVE_TEST_SERVER_ADDRESS` environment variable somewhere in your
|
||||
code (for example in a :ref:`custom test runner<topics-testing-test_runner>`
|
||||
if you're using one):
|
||||
code (for example, in a :ref:`custom test runner<topics-testing-test_runner>`):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@ -1790,18 +1789,18 @@ if you're using one):
|
||||
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8082'
|
||||
|
||||
In the case where the tests are run by multiple processes in parallel (for
|
||||
example in the context of several simultaneous `continuous integration`_
|
||||
builds), the processes will compete for the same address and therefore your
|
||||
example, in the context of several simultaneous `continuous integration`_
|
||||
builds), the processes will compete for the same address, and therefore your
|
||||
tests might randomly fail with an "Address already in use" error. To avoid this
|
||||
problem, you can pass a comma-separated list of ports or ranges of ports (at
|
||||
least as many as the number of potential parallel processes), for example:
|
||||
least as many as the number of potential parallel processes). For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./manage.py test --liveserver=localhost:8082,8090-8100,9000-9200,7041
|
||||
|
||||
Then, during the execution of the tests, each new live test server will try
|
||||
every specified port until it finds one that is free and takes it.
|
||||
Then, during test execution, each new live test server will try every specified
|
||||
port until it finds one that is free and takes it.
|
||||
|
||||
.. _continuous integration: http://en.wikipedia.org/wiki/Continuous_integration
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user