Skip to content

Commit

Permalink
Fix DHT tests failing because of repeated addresses
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kubuxu committed Jun 14, 2016
1 parent 79e9bd8 commit 32cdbbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 32cdbbd

Please sign in to comment.