From patchwork Tue Sep 22 16:11:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Damien Lespiau X-Patchwork-Id: 521178 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 940501401AD for ; Wed, 23 Sep 2015 02:13:32 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 798991A01DE for ; Wed, 23 Sep 2015 02:13:32 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lists.ozlabs.org (Postfix) with ESMTP id 6F7311A0024 for ; Wed, 23 Sep 2015 02:12:27 +1000 (AEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 22 Sep 2015 09:12:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,573,1437462000"; d="scan'208";a="794882646" Received: from pjanik-mobl1.ger.corp.intel.com (HELO strange.ger.corp.intel.com) ([10.252.32.80]) by fmsmga001.fm.intel.com with ESMTP; 22 Sep 2015 09:12:02 -0700 From: Damien Lespiau To: patchwork@lists.ozlabs.org Subject: [PATCH 6/6] tox: Use a range of ports for live servers in case of concurrent runs Date: Tue, 22 Sep 2015 17:11:49 +0100 Message-Id: <1442938309-3195-7-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1442938309-3195-1-git-send-email-damien.lespiau@intel.com> References: <1442938309-3195-1-git-send-email-damien.lespiau@intel.com> MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" From: https://docs.djangoproject.com/en/1.8/topics/testing/tools/#liveservertestcase 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 tests might randomly fail with an “Address already in use” error. And indeed it was hapening in my setup: Traceback (most recent call last): File ".../python2.7/site-packages/django/test/testcases.py", line 1193, in setUpClass raise cls.server_thread.error error: [Errno 98] Address already in use Signed-off-by: Damien Lespiau Acked-by: Stephen Finucane --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c04825e..e4d54bd 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,8 @@ deps = setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev commands = - {toxinidir}/manage.py test --noinput '{posargs:patchwork}' + {toxinidir}/manage.py test --noinput --liveserver=localhost:9000-9200 \ + '{posargs:patchwork}' passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY PW_TEST_DB_USER PW_TEST_DB_PASS DISPLAY