Loading docs/topics/testing.txt +6 −7 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading
docs/topics/testing.txt +6 −7 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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