Skip Menu |

This queue is for tickets about the Net-LDAP-Server-Test CPAN distribution.

Report information
The Basics
Id: 69615
Status: resolved
Priority: 0/
Queue: Net-LDAP-Server-Test

People
Owner: karman [...] cpan.org
Requestors: DAKKAR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.11
Fixed in: (no value)



Subject: tests hang because they try to create 2 test LDAP servers at the same time
I have just tried installing Net-LDAP-Server-Test 0.11. and the 01-ldap.t test could not complete. What happened is: - a test server is created, listening on port 10636 - some tests are performed against it - the test file then tries to create another test server, on the same port - the test server fails the "listen" call, and shuts down without sending anything on the pipe - the tests hangs I have worked around the issue by adding: kill 15, $$server; waitpid $$server,0; before creating the new test server. It's a rather ugly solution, and a "stop" method would be much cleaner. I can't understand why everybody on CPANTesters has the tests passing, though… if you think I'm doing something very wrong, please help :)
Better analysis: it's a race condition. I've now noticed that the test server will exit when the client unbinds. Problem is, sometimes it dies too late. A «waitpid $$server,0» is enough to avoid the problem, no "kill" necessary.
I have added a stop() method that calls waitpid() internally per your suggestions. Note that the DESTROY() method used to call waitpid() but that was commented out due it causing tests to hang on some systems, presumably for reasons opposite to what you were seeing. I'm not sure now which systems these were, since the svn history for that period of development is no longer available to me. In any case, please try from svn trunk and see if that works for you. If it does, I will push out a 0.12 release. https://svn.msi.umn.edu/sw/perl/Net-LDAP-Server-Test/trunk/
0.12 uploaded to cpan.