joyent/libuv — pull request #1094 by calid (2014-01-31 17:52:06+00:00)
Title: Getaddrinfo fail timeout

On my machine `getaddrinfo_fail` consistently times out:

=============================================================
[% 61|+ 125|- 0|T 0|S 0]: getaddrinfo_fail
`getaddrinfo_fail` failed: timeout
Output from process `getaddrinfo_fail`: (no output)
=============================================================
[% 100|+ 203|- 1|T 0|S 0]: Done.
FAIL: test/run-tests

Tracing through the call stack showed that `getaddrinfo` was taking just a bit longer than the 5 second timeout to give up on the fake hostname:

$ test/run-tests getaddrinfo_fail getaddrinfo_fail
getaddrinfo_fail start: 1391183554.344
uv_getaddrinfo start: 1391183554.344
uv_getaddrinfo end: 1391183554.344
uv__getaddrinfo_work start: 1391183554.344
getaddrinfo start: 1391183554.344
uv__io_poll start: 1391183554.344
uv__epoll_wait start: 1391183554.344
getaddrinfo end: 1391183559.457
uv__getaddrinfo_work end: 1391183559.457
uv__epoll_wait end: 1391183559.457
uv__async_io start: 1391183559.457
uv__async_event start: 1391183559.457
uv__work_done start: 1391183559.457
uv__getaddrinfo_done start: 1391183559.457
uv__getaddrinfo_done end: 1391183559.457
getaddrinfo_fail_cb start: 1391183559.457
getaddrinfo_fail_cb end: 1391183559.457
uv__work_done end: 1391183559.457
uv__async_event end: 1391183559.457
getaddrinfo_fail end: 1391183559.457

In this patch I've upped the timeout to 10000 to compensate. I've also modified the test harness to support setting timeouts on a per-test basis (e.g. *only* getaddrinfo_fail has a 10000 timeout, the other tests remain at the default).

I worked my way through the contribution guidelines, so hopefully everything is in order. Let me know if there's anything I missed.

Thank you!