tests: Solidify tcp connection check
authorEdward Hervey <edward@centricular.com>
Sat, 27 Oct 2018 13:48:13 +0000 (15:48 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Sat, 27 Oct 2018 13:48:13 +0000 (15:48 +0200)
commit33e92afd91274e8b63aceccded344a266d401248
tree33f29ea7439a8b9c3448437d20fb215681430f7b
parenta15baf797603c6c65e442f488f20993d800bbbc1
tests: Solidify tcp connection check

The previous failure was a timeout which was due to the sending pipeline
pushing test buffer *before* the remote client was accepted. We would
therefore never get the buffer on the other side.

While the client socket would indeed appear as "connected", this doesn't
mean that the remote server side did "accept" it (which is where we then
add it to the list of remote parties to which data will be sent).

The problem isn't with the element implementation, but to the nature of
TCP 3-way handshake.

In order to make the test reliable, wait for the sink to have accepted
the remote client (by checking the number of handles) before sending out
test buffers.
tests/check/pipelines/tcp.c