test: skip self-connecting tests on cygwin

The cygwin runtime library fails to connect a socket client to a
listening server within the same thread.  Test cases that use
this approach hang while waiting for the connection to complete.
This can be reproduced independent of libuv in a simple example
using both socket/bind/listen and socket/connect in a single
thread.

Avoid this problem in our test suite by skipping such tests on cygwin.

PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
Brad King 2017-04-06 21:59:24 -04:00 committed by Ben Noordhuis
parent 580f032737
commit 621655352c
6 changed files with 26 additions and 0 deletions

View File

@ -221,4 +221,12 @@ UNUSED static int can_ipv6(void) {
"Cygwin runtime does not support sending handles on pipes."
#endif
#if defined(__MSYS__)
# define NO_SELF_CONNECT \
"MSYS2 runtime hangs on listen+connect in same process."
#elif defined(__CYGWIN__)
# define NO_SELF_CONNECT \
"Cygwin runtime hangs on listen+connect in same process."
#endif
#endif /* TASK_H_ */

View File

@ -116,6 +116,9 @@ TEST_IMPL(pipe_bind_error_inval) {
TEST_IMPL(pipe_listen_without_bind) {
#if defined(NO_SELF_CONNECT)
RETURN_SKIP(NO_SELF_CONNECT);
#endif
uv_pipe_t server;
int r;

View File

@ -70,6 +70,9 @@ static void connect_cb(uv_connect_t* connect_req, int status) {
TEST_IMPL(pipe_connect_multiple) {
#if defined(NO_SELF_CONNECT)
RETURN_SKIP(NO_SELF_CONNECT);
#endif
int i;
int r;
uv_loop_t* loop;

View File

@ -87,6 +87,9 @@ static void pipe_server_connection_cb(uv_stream_t* handle, int status) {
TEST_IMPL(pipe_getsockname) {
#if defined(NO_SELF_CONNECT)
RETURN_SKIP(NO_SELF_CONNECT);
#endif
uv_loop_t* loop;
char buf[1024];
size_t len;

View File

@ -61,6 +61,9 @@ static void pipe_server_connection_cb(uv_stream_t* handle, int status) {
TEST_IMPL(pipe_server_close) {
#if defined(NO_SELF_CONNECT)
RETURN_SKIP(NO_SELF_CONNECT);
#endif
uv_loop_t* loop;
int r;

View File

@ -574,6 +574,9 @@ static void start_poll_test(void) {
TEST_IMPL(poll_duplex) {
#if defined(NO_SELF_CONNECT)
RETURN_SKIP(NO_SELF_CONNECT);
#endif
test_mode = DUPLEX;
start_poll_test();
return 0;
@ -581,6 +584,9 @@ TEST_IMPL(poll_duplex) {
TEST_IMPL(poll_unidirectional) {
#if defined(NO_SELF_CONNECT)
RETURN_SKIP(NO_SELF_CONNECT);
#endif
test_mode = UNIDIRECTIONAL;
start_poll_test();
return 0;