lwt
lwt copied to clipboard
Test suite hang : "Unix test 29, establish_server_1: shutdown: client closes first"
Running with the libev backend on Ubuntu 12.04 or 14.04 (in VirtualBox) leads to the test suite hanging on this test.
Switching the libev back to use select makes the test work ie
LIBEV_FLAGS=1 ./_build/test/unix/main.native
So it seems to be something to do with whatever default backend is chosen on Linux. Neither LIBEV_FLAGS=2 (poll) of LIBEV_FLAGS=4 (epoll; default?) work.
I added some printfs to trace the tests. It should look like
handler_wait...
wait_for_client...
with_connection...
wakeup_client...
handler close...
shutdown server...
When it hangs we get
handler_wait...
with_connection...
wakeup_client...
shutdown server...
It seems the server is shutdown before the handler is even woken up. Sleeping just before the server shutdown lets the test work.
Further update; it also fails on ubuntu 16.04 when run in Virtualbox, while working fine on my native 16.04 laptop.
So this problem is something to do with running lwt under Virtualbox.