diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt index 5eef2dc092..ea2c52b097 100644 --- a/docs/topics/testing.txt +++ b/docs/topics/testing.txt @@ -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` -if you're using one): +code (for example, in a :ref:`custom 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