Bug#730908: libio-event-perl: FTBFS: Failed tests

Niko Tyni ntyni at debian.org
Sat Dec 12 09:41:33 UTC 2015


Control: tag -1 patch

On Sat, Nov 30, 2013 at 09:17:11PM +0100, gregor herrmann wrote:
> On Sat, 30 Nov 2013 17:33:15 +0100, David Suárez wrote:
> 
> > > t/forked1.t ..... ok
> > > # Looks like you planned 115 tests but ran 111.
> > > print 26175: Connection reset by peer
> > > Compilation failed in require at t/forked2.t line 5.
> > > t/forked2.t ..... 
> > > Dubious, test returned 255 (wstat 65280, 0xff00)
> > > Failed 4/115 subtests 
> 
> Now that's an intereting bug.
> The tests still pass for me but take quite some long. So maybe we're
> running into a timeout here, or some other fork problem on the amazon
> build machine ...

What happens here is that

- the test script forks, the parent sets up a TCP server and starts an
  event loop for clients
- child connects there, sends test data and synchronizes on event
  indications from the parent
- for every test data group, client disconnects when it has sent
  all the data and then makes a new connection for the next group
- when the parent gets a new connection, it decrements its counter
  of tests left (in ie_connection())
- when the parent gets an EOF from a client connection, it exits
  if the test counter is zero (in ie_eof())

Now, it can happen that the client disconnect and the next connect both
happen before the parent gets CPU time. In this case, the parent may get
the 'new connection' event before the 'eof' event. This wouldn't matter
otherwise, but if it's the last test group starting, ie_connection()
decrements the counter to zero first, and ie_eof() thinks it's all done
even though a new connection has just been accepted.

The parent then does an exit(0) in ie_eof(), the child gets a connection
reset, and an END block in the test libraries notices that there were
too few tests and dies.

The attached patch should fix it by making the client synchronize on the
eof event from the parent before making a new connection. Will send
it properly upstream once rt.cpan.org is up again.
-- 
Niko Tyni   ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-undeterministic-test-failures-in-t-forked2.t.patch
Type: text/x-diff
Size: 1024 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20151212/6ac3c765/attachment-0001.patch>


More information about the pkg-perl-maintainers mailing list