From 32cdbbdffad30192028ec071936f08f736031726 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 14 Jun 2016 16:39:15 +0200 Subject: [PATCH] Fix DHT tests failing because of repeated addresses Due to SO_REUSE_PORT it is possible for a localhost:0 address to repeat. This causes failure in DHT tests where we spun up a lot of nodes inside test. As for a birthday paradox it is enough to use 140 ports to get 20% chance for collision which was causing failure in our case. The fix is to disable REUSE_PORT routine for the tests and leave it running for sharness tests where not that many addresses are used at the same time. License: MIT Signed-off-by: Jakub Sztandera --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f68dee72c40..666224af474 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,9 @@ IPFS_MIN_GX_VERSION = 0.6 IPFS_MIN_GX_GO_VERSION = 1.1 ifeq ($(TEST_NO_FUSE),1) - go_test=go test -tags nofuse + go_test=IPFS_REUSEPORT=false go test -tags nofuse else - go_test=go test + go_test=IPFS_REUSEPORT=false go test endif @@ -92,10 +92,10 @@ test_go_race: $(go_test) ./... -race test_sharness_short: - cd test/sharness/ && make + make -C test/sharness/ test_sharness_expensive: - cd test/sharness/ && TEST_EXPENSIVE=1 make + TEST_EXPENSIVE=1 make -C test/sharness/ test_all_commits: @echo "testing all commits between origin/master..HEAD"