@cryptotaxi247 / kubo / commits / 32cdbbdff

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 <kubuxu@protonmail.ch>

Jakub Sztandera committed Jun 14, 2016 at 16:39 UTC 32cdbbdffad30192028ec071936f08f736031726
1 file changed +4 -4
Makefile
+4 -4
@@ -4,9 +4,9 @@ IPFS_MIN_GX_VERSION = 0.6
4 IPFS_MIN_GX_GO_VERSION = 1.1
5
6 ifeq ($(TEST_NO_FUSE),1)
7 - go_test=go test -tags nofuse
7 + go_test=IPFS_REUSEPORT=false go test -tags nofuse
8 else
9 - go_test=go test
9 + go_test=IPFS_REUSEPORT=false go test
10 endif
11
12
@@ -92,10 +92,10 @@ test_go_race:
92 $(go_test) ./... -race
93
94 test_sharness_short:
95 - cd test/sharness/ && make
95 + make -C test/sharness/
96
97 test_sharness_expensive:
98 - cd test/sharness/ && TEST_EXPENSIVE=1 make
98 + TEST_EXPENSIVE=1 make -C test/sharness/
99
100 test_all_commits:
101 @echo "testing all commits between origin/master..HEAD"