Skip Menu |

This queue is for tickets about the Catalyst-Authentication-Store-LDAP CPAN distribution.

Report information
The Basics
Id: 83900
Status: resolved
Priority: 0/
Queue: Catalyst-Authentication-Store-LDAP

People
Owner: karman [...] cpan.org
Requestors: chisel [...] chizography.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.013
Fixed in: 1.014



Subject: Unable to listen on port 10636: Address already in use
The tests for this module regularly fail to complete because (for whatever reason) they aren't cleanly finishing with the test port. e.g.: ➔ prove -lr t/ t/01-basic.t .................. 1/2 # Testing Catalyst::Authentication::Store::LDAP version 1.013 # Testing Catalyst version 5.80032 t/01-basic.t .................. ok t/02-realms_api.t ............. Creating new LDAP server on port 10636 ... t/02-realms_api.t ............. 1/5 Accepted connection from: 127.0.0.1 ... shutting down server t/02-realms_api.t ............. ok t/03-entry_class.t ............ Creating new LDAP server on port 10636 ... t/03-entry_class.t ............ 1/6 Accepted connection from: 127.0.0.1 ... shutting down server t/03-entry_class.t ............ ok t/04-user_class.t ............. Creating new LDAP server on port 10636 ... t/04-user_class.t ............. 1/8 Accepted connection from: 127.0.0.1 Creating new LDAP server on port 10636 ... Unable to listen on port 10636: Address already in use at /opt/xt/xt- perl/lib/site_perl/5.14.2/Net/LDAP/Server/Test.pm line 852. ... shutting down server It seems to happen *every* time I run the tests locally. I tried using Net::EmptyPort::wait_port() [from Test::TCP >= 1.20] bit it gave unexpected and worse results. I also tried empty_port() with no success. [example in attached patch] I'm not sure what the 'best' solution is but this is a regular blocker for the internal perl+cpan RPM build at NAP. I could distropref out the test, but I'd prefer not to if there are better solutions. Any thoughts?
Subject: ldap_port.patch.txt
diff -Naur Catalyst-Authentication-Store-LDAP-1.013/Makefile.PL Catalyst-Authentication-Store-LDAP-1.013.patched/Makefile.PL --- Catalyst-Authentication-Store-LDAP-1.013/Makefile.PL 2013-01-09 14:43:26.000000000 +0000 +++ Catalyst-Authentication-Store-LDAP-1.013.patched/Makefile.PL 2013-03-12 12:25:56.000000000 +0000 @@ -14,6 +14,7 @@ build_requires('Test::More'); build_requires('Test::MockObject'); build_requires('Test::Exception'); +build_requires('Test::TCP' => '1.20'); resources repository => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Authentication-Store-LDAP/trunk/'; diff -Naur Catalyst-Authentication-Store-LDAP-1.013/t/lib/LDAPTest.pm Catalyst-Authentication-Store-LDAP-1.013.patched/t/lib/LDAPTest.pm --- Catalyst-Authentication-Store-LDAP-1.013/t/lib/LDAPTest.pm 2013-03-12 12:16:23.000000000 +0000 +++ Catalyst-Authentication-Store-LDAP-1.013.patched/t/lib/LDAPTest.pm 2013-03-12 12:20:12.000000000 +0000 @@ -5,7 +5,9 @@ use Net::LDAP::Server::Test; use Net::LDAP::Entry; -sub server_port {10636} +use Net::EmptyPort 'empty_port'; + +sub server_port { return empty_port(); } sub server_host { 'ldap://127.0.0.1:' . server_port() } sub spawn_server {
Far from idea, but adding a sleep(1) to t/04-user_class.t seems to give the server enough time to stop before spawning a new one: + sleep(1); $server = LDAPTest::spawn_server(); ok $user->check_password('foo'), 'Can check password';
I'll have a look once I've got past Net::LDAP::Server::Test's installation problem(s). We've currently got 0.11 and I realised that we needed a later version for the stop() method. It looks like the right solution [$server->stop()] but it's not easy to confirm right away. Show quoted text
---- cut here ---- CPAN.pm: Going to build K/KA/KARMAN/Net-LDAP-Server-Test-0.17.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Net::LDAP::Server::Test Writing MYMETA.yml and MYMETA.json cp lib/Net/LDAP/Server/Test.pm blib/lib/Net/LDAP/Server/Test.pm Manifying blib/man3/Net::LDAP::Server::Test.3 KARMAN/Net-LDAP-Server-Test-0.17.tar.gz /usr/bin/make -j 3 -j 3 -- OK Running make test PERL_DL_NONLAZY=1 /opt/xt/xt-perl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-load.t ........... 1/1 # Testing Net::LDAP::Server::Test 0.17, Perl 5.014002, /opt/xt/xt- perl/bin/perl t/00-load.t ........... ok t/01-ldap.t ........... 1/12 # stop() server waitpid(7244, 0) took too long Unable to listen on port 10636: Address already in use at /tmp/.cpan/build/Net-LDAP- Server-Test-0.17-5k9t6t/blib/lib/Net/LDAP/Server/Test.pm line 964.
---- cut here ----
Is this still an issue? 1.014 would have contained the change in the tests and I see no failures on cpantesters.
This has not been a problem since 1.014.