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:
Adrian Holovaty 2011-12-30 20:34:07 +00:00
parent 32ee74f89e
commit ffb0519d44
1 changed files with 6 additions and 7 deletions

View File

@ -1781,8 +1781,7 @@ via the :djadminopt:`--liveserver` option, for example:
Another way of changing the default server address is by setting the Another way of changing the default server address is by setting the
`DJANGO_LIVE_TEST_SERVER_ADDRESS` environment variable somewhere in your `DJANGO_LIVE_TEST_SERVER_ADDRESS` environment variable somewhere in your
code (for example in a :ref:`custom test runner<topics-testing-test_runner>` code (for example, in a :ref:`custom test runner<topics-testing-test_runner>`):
if you're using one):
.. code-block:: python .. code-block:: python
@ -1790,18 +1789,18 @@ if you're using one):
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8082' os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8082'
In the case where the tests are run by multiple processes in parallel (for In the case where the tests are run by multiple processes in parallel (for
example in the context of several simultaneous `continuous integration`_ example, in the context of several simultaneous `continuous integration`_
builds), the processes will compete for the same address and therefore your 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 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 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 .. code-block:: bash
./manage.py test --liveserver=localhost:8082,8090-8100,9000-9200,7041 ./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 Then, during test execution, each new live test server will try every specified
every specified port until it finds one that is free and takes it. port until it finds one that is free and takes it.
.. _continuous integration: http://en.wikipedia.org/wiki/Continuous_integration .. _continuous integration: http://en.wikipedia.org/wiki/Continuous_integration