aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-06 21:59:24 -0400
committerBen Noordhuis <info@bnoordhuis.nl>2017-05-21 16:12:30 +0200
commit621655352c4f591946207e7cf58664a6c4ad03e4 (patch)
tree18d1c28b4241cc0d679fb3da267e9aa49d0bf190
parent580f0327370381363fe842db0c9424f9346810f5 (diff)
downloadlibuv-621655352c4f591946207e7cf58664a6c4ad03e4.tar.gz
libuv-621655352c4f591946207e7cf58664a6c4ad03e4.zip
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>
-rw-r--r--test/task.h8
-rw-r--r--test/test-pipe-bind-error.c3
-rw-r--r--test/test-pipe-connect-multiple.c3
-rw-r--r--test/test-pipe-getsockname.c3
-rw-r--r--test/test-pipe-server-close.c3
-rw-r--r--test/test-poll.c6
6 files changed, 26 insertions, 0 deletions
diff --git a/test/task.h b/test/task.h
index 82483207..67eb9804 100644
--- a/test/task.h
+++ b/test/task.h
@@ -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_ */
diff --git a/test/test-pipe-bind-error.c b/test/test-pipe-bind-error.c
index 38b57db6..9cf93165 100644
--- a/test/test-pipe-bind-error.c
+++ b/test/test-pipe-bind-error.c
@@ -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;
diff --git a/test/test-pipe-connect-multiple.c b/test/test-pipe-connect-multiple.c
index 3de5a9a0..0a60d4a9 100644
--- a/test/test-pipe-connect-multiple.c
+++ b/test/test-pipe-connect-multiple.c
@@ -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;
diff --git a/test/test-pipe-getsockname.c b/test/test-pipe-getsockname.c
index 4b4ceccc..d1628a67 100644
--- a/test/test-pipe-getsockname.c
+++ b/test/test-pipe-getsockname.c
@@ -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;
diff --git a/test/test-pipe-server-close.c b/test/test-pipe-server-close.c
index 1dcdfffa..ea9977dd 100644
--- a/test/test-pipe-server-close.c
+++ b/test/test-pipe-server-close.c
@@ -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;
diff --git a/test/test-poll.c b/test/test-poll.c
index 0cf6740f..7cfc159a 100644
--- a/test/test-poll.c
+++ b/test/test-poll.c
@@ -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;