[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

test-poll failing on FreeBSD 10/11

From: Daniel P . Berrangé
Subject: test-poll failing on FreeBSD 10/11
Date: Tue, 8 May 2018 17:40:50 +0100
User-agent: Mutt/1.9.3 (2018-01-21)

Libvirt CI recently started running "make check" on our FreeBSD 10 & 11
hosts, and we see frequent failure of the test-poll unit test in gnulib
IIUC,  gnulib is not actually building a replacement poll() function
on FreeBSD, it is merely running the gnulib test suite against the
FreeBSD system impl of poll() and hitting this behaviour.

$ ./gnulib/tests/test-poll
Unconnected socket test... passed
Connected sockets test... failed (expecting POLLHUP after shutdown)
General socket test with fork... failed (expecting POLLHUP after shutdown)
Pipe test... passed

Looking at the first failure in test_socket_pair method.

It sets up a listener socket, connects a client, accepts the client
and then closes the remote end. It expects the server's client socket
to thus show POLLHUP or POLLERR.

When it fails, the poll() is in fact still showing POLLOUT. If you put
a sleep between the close () and poll() calls, it will succeed.

So, IIUC, the test is racing with the BSD kernel's handling of socket
close - the test can't assume that just because the remote end of the
client has been closed, that poll() will immediately show POLLHUP|ERR.

Anyone have ideas on how to make this test more reliable and not depend
on the kernel synchronizing the close() state with poll() results
immediately ?

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

reply via email to

[Prev in Thread] Current Thread [Next in Thread]