fix flaky ConnectTFOTimeout and ConnectTFOFallbackTimeout tests
authorAdam Simpkins <simpkins@fb.com>
Tue, 5 Jul 2016 18:20:28 +0000 (11:20 -0700)
committerFacebook Github Bot 7 <facebook-github-bot-7-bot@fb.com>
Tue, 5 Jul 2016 18:23:29 +0000 (11:23 -0700)
commita3bd593ad9374cd3a1db31066874b9bad1cf74b4
tree8d1e9d85dd55f9d4cc3c0b9944a3b896d3a03ec7
parentdc93938852aa64604563afbc8d185062f01153f2
fix flaky ConnectTFOTimeout and ConnectTFOFallbackTimeout tests

Summary:
In the ConnectTFOTimeout and ConnectTFOFallbackTimeout tests in
AsyncSSLSocketTest.cpp, the client runs for 1ms before timing out and quitting.
It may end up shutting down the server thread before the server has even
received the TCP connect callback.  If this happened it would cause the test to
fail, since the server code checked to make sure the callback was invoked.

This diff creates a new ConnectTimeoutCallback server-side callback for these
tests to use, which doesn't care if it gets told about a new connection or not.

Reviewed By: siyengar

Differential Revision: D3512809

fbshipit-source-id: ce77fe944fb06a38a84c1458356f161cec7387b3
folly/io/async/test/AsyncSSLSocketTest.cpp
folly/io/async/test/AsyncSSLSocketTest.h