From 6dbad0f6715e1a594cfd0115d929f7f15fcb5f93 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 4 Feb 2019 22:34:10 +0300 Subject: [PATCH] test/dns: in solaris under EMFILE devpoll does not dispatch (due DP_POLL failure) --- test/regress_dns.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/regress_dns.c b/test/regress_dns.c index df696f0c..9f1d6283 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -1215,6 +1215,7 @@ test_bufferevent_connect_hostname(void *arg) int success = BEV_EVENT_CONNECTED; int default_error = 0; unsigned i; + int ret; if (emfile) { success = BEV_EVENT_ERROR; @@ -1225,6 +1226,7 @@ test_bufferevent_connect_hostname(void *arg) #elif defined(__sun__) /* on solaris it returns EAI_FAIL */ default_error = EVUTIL_EAI_FAIL; + /** the DP_POLL can also fail with EINVAL under EMFILE */ #else /* on osx/freebsd it returns EAI_NONAME */ default_error = EVUTIL_EAI_NONAME; @@ -1307,7 +1309,17 @@ test_bufferevent_connect_hostname(void *arg) tt_assert(!bufferevent_socket_connect_hostname(be[2], dns, AF_INET, "nobodaddy.example.com", listener_port)); - event_base_dispatch(data->base); + ret = event_base_dispatch(data->base); +#ifdef __sun__ + if (emfile && !strcmp(event_base_get_method(data->base), "devpoll")) { + tt_int_op(ret, ==, -1); + /** DP_POLL failed */ + tt_skip(); + } else +#endif + { + tt_int_op(ret, ==, 0); + } tt_int_op(be_outcome[0].what, ==, BEV_EVENT_ERROR); tt_int_op(be_outcome[0].dnserr, ==, EVUTIL_EAI_NONAME); -- 2.40.0