]> git.meshlink.io Git - meshlink/commit
test/channel: don't let both sides connect to each other simultaneously.
authorGuus Sliepen <guus@meshlink.io>
Fri, 7 Nov 2014 23:53:58 +0000 (23:53 +0000)
committerGuus Sliepen <guus@meshlink.io>
Sat, 27 Dec 2014 17:29:50 +0000 (18:29 +0100)
commitda333d8fb50d4a0440d1a712577a3b09a6c881c5
tree822fdc7f43a3a9110ebb466a73a89975c8517c1d
parent546eb066092803d218c5b31d32af724c42bee2a1
test/channel: don't let both sides connect to each other simultaneously.

The channel test fails to work reliably when the two threads are started
exactly simultaneously and both sides try to connect to each other. Both
sides simultaneously initiate a end-to-end SPTPS connection by sending
the appropriate req_key request, but upon reception of each others
request they reset their own state, causing SPTPS packets from the old
and the new state to cross each other. A timeout will occur eventually,
causing one side to try to restart the SPTPS connection. Since the
timeouts are slightly randomized, this sometimes causes the channel test
to work, sometimes not.
test/channels.c