Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 73871
Status: rejected
Worked: 5 min
Priority: 0/
Queue: Net-DNS

People
Owner: willem [...] cpan.org
Requestors: cpan698301 [...] mstier.de
ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.71
Fixed in: (no value)



Subject: Test not reliable, port still in use
Test not reliable. See appended test output: make[1]: Entering directory `/usr/src/packages/BUILD/Net-DNS' PERL_DL_NONLAZY=1 /opt/perl-5.14.2/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t # # These tests were run using: # Net::DNS::VERSION: 0.67 # set environment variable NET_DNS_DEBUG to get all versions t/00-load.t ....................... ok t/00-pod.t ........................ ok t/00-version.t .................... ok t/01-resolver-env.t ............... ok t/01-resolver-file.t .............. ok t/01-resolver-flags.t ............. ok t/01-resolver-opt.t ............... ok t/01-resolver.t ................... ok t/02-domain.t ..................... ok t/02-domainname.t ................. ok t/02-header.t ..................... ok t/03-question.t ................... ok t/04-packet-unique-push.t ......... ok t/04-packet.t ..................... ok t/05-apl.t ........................ ok t/05-rr-opt.t ..................... ok t/05-rr-rrsort.t .................. ok t/05-rr-sshfp.t ................... skipped: Digest::BubbleBabble not installed. t/05-rr-txt.t ..................... ok t/05-rr-unknown.t ................. ok t/05-rr-various.t ................. ok # Number of RRs: 33 Number of methods: 127 t/05-rr.t ......................... ok t/06-update.t ..................... ok t/07-misc.t ....................... ok t/08-online.t ..................... skipped: Online tests disabled. t/09-tkey.t ....................... ok t/10-recurse.t .................... skipped: Online tests disabled. # Using the XS compiled dn_expand function # # disabling XS based dns_expand for a moment. # # Continuing to use the XS based dn_expand() t/11-escapedchars.t ............... ok t/11-inet6.t ...................... skipped: Online tests disabled. 123456789112345678921234567893123456789412345678951234567896123... truncated to 63 octets (RFC1035 2.3.1) at t/12-compression.t line 56 t/12-compression.t ................ ok # Testing availability of 127.0.0.1 t/13-udp-trunc.t .................. ok Couldn't create TCP socket: Address already in use at /usr/src/packages/BUILD/Net-DNS/blib/lib/Net/DNS/Nameserver.pm line 98 Net::DNS::Nameserver::new('YetAnotherNameserver', 'LocalAddr', 127.0.0.1, 'LocalPort', 34515) called at t/17-pure-virtual-replyhandler.t line 171 # Failed test 'Overloaded ReplyHandler' # at t/17-pure-virtual-replyhandler.t line 180. # got: undef # expected: 'example. 3600 IN TXT "YetAnotherNameserver"' # Looks like you failed 1 test of 6. t/17-pure-virtual-replyhandler.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/6 subtests # Cleaning t/99-cleanup.t .................... ok Test Summary Report ------------------- t/17-pure-virtual-replyhandler.t (Wstat: 256 Tests: 6 Failed: 1) Failed test: 6 Non-zero exit status: 1 Files=33, Tests=1672, 19 wallclock secs ( 0.49 usr 0.19 sys + 7.17 cusr 1.21 csys = 9.06 CPU) Result: FAIL Failed 1/33 test programs. 1/1672 subtests failed. make[1]: *** [test_dynamic] Error 255 make[1]: Leaving directory `/usr/src/packages/BUILD/Net-DNS'
Thanks. The test is removed from version 0.68. I think it might be an interesting feature to be able to create a Net::DNS::Nameserver object from a socket in stead of specifying and address and port. This would resolve your issue too.
Subject: t/13-udp-trunc.t can fail because UDP port is in use already
I obtained t/13-udp-trunc.t failure: # Testing availability of 127.0.0.1 Couldn't create TCP socket: Address already in use at /builddir/build/BUILD/Net-DNS-0.71/blib/lib/Net/DNS/Nameserver.pm line 128. Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 5334, 'LocalAddr', 127.0.0.1, 'ReplyHandler', 'CODE(0x1000b9b3e68)') called at t/13-udp-trunc.t line 63 Couldn't create UDP socket: Address already in use at /builddir/build/BUILD/Net-DNS-0.71/blib/lib/Net/DNS/Nameserver.pm line 147. Net::DNS::Nameserver::new('Net::DNS::Nameserver', 'LocalPort', 5334, 'LocalAddr', 127.0.0.1, 'ReplyHandler', 'CODE(0x1000b9b3e68)') called at t/13-udp-trunc.t line 63 Can't call method "udp_connection" on an undefined value at t/13-udp-trunc.t line 90. # Looks like you planned 100 tests but ran 1. # Looks like your test exited with 255 just after 1. t/13-udp-trunc.t ........... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 99/100 subtests Reading the code, you try to create UDP socket on fixed 127.0.0.1:5334 in BEGIN block, then you close the socket and then you try to bind again using Net::DNS::Nameserver->new(). There is race condition between the two socket creation and I was unlucky to hit it. I can see two choices how to fix it: (1) Extend Net::DNS::Nameserver::new() to accept already bound socket next to LocalAddr and LocalPort. (2) Extend Net::DNS::Nameserver::new() to pick random free port and report the port number or socket to the caller. E.g. by a passing RandomLocalPort => \$TestPort instead of LocalPort => $TestPort. Of course it's still possible not to solve this problem and to just skip test plan if et::DNS::Nameserver::new() fails.
From: rwfranks [...] acm.org
On Mon Dec 17 11:55:39 2012, ppisar wrote: Show quoted text
> I obtained t/13-udp-trunc.t failure:
This test script has not been in the distributed tarball since 0.73 I guess the problem went with it.
13-udp-trunc.t removed in 0.73