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:
parent
580f032737
commit
621655352c
@ -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_ */
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user