Skip Menu |

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

Report information
The Basics
Id: 67794
Status: open
Priority: 0/
Queue: Net-RabbitMQ

People
Owner: Nobody in particular
Requestors: piotr_poznanski [...] o2.pl
Cc:
AdminCc:

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



Subject: installation hangs
Date: Wed, 27 Apr 2011 18:07:18 +0200
To: bug-Net-RabbitMQ [...] rt.cpan.org
From: Piotr Poznanski <piotr_poznanski [...] o2.pl>
Hello, I tried it both on ubutnu desktop and server 32bits (running under vmware) 10.04 LTS, and I can see that in both cases installation hangs on t/002_publish.t (after sometimes 3 or 5 or 6 tests done) I'm trying to install: (cpan -i) Net-RabbitMQ-0.2.0 perl vesrion: v5.10.1 (*) built for i486-linux-gnu-thread-multi OS: server: Linux ubuntu 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:24:35 UTC 2011 i686 GNU/Linux desktop: Linux ubuntu 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux terminal dump - server poznan@ubuntu:~$ sudo cpan -i Net::RabbitMQ CPAN: Storable loaded ok (v2.20) Going to read '/home/poznan/.local/share/.cpan/Metadata' Database was generated on Wed, 27 Apr 2011 14:30:52 GMT Running install for module 'Net::RabbitMQ' CPAN: YAML loaded ok (v0.72) Running make for J/JE/JESUS/Net-RabbitMQ-0.2.0.tar.gz CPAN: Digest::SHA loaded ok (v5.47) CPAN: Compress::Zlib loaded ok (v2.02) Checksum for /home/poznan/.local/share/.cpan/sources/authors/id/J/JE/JESUS/Net-RabbitMQ-0.2.0.tar.gz ok CPAN: Archive::Tar loaded ok (v1.52) Net-RabbitMQ-0.2.0/ Net-RabbitMQ-0.2.0/amqp.h Net-RabbitMQ-0.2.0/amqp_api.c Net-RabbitMQ-0.2.0/amqp_config.h Net-RabbitMQ-0.2.0/amqp_connection.c Net-RabbitMQ-0.2.0/amqp_debug.c Net-RabbitMQ-0.2.0/amqp_framing.c Net-RabbitMQ-0.2.0/amqp_framing.h Net-RabbitMQ-0.2.0/amqp_mem.c Net-RabbitMQ-0.2.0/amqp_private.h Net-RabbitMQ-0.2.0/amqp_socket.c Net-RabbitMQ-0.2.0/amqp_table.c Net-RabbitMQ-0.2.0/Changes Net-RabbitMQ-0.2.0/LICENSE Net-RabbitMQ-0.2.0/LICENSE-MPL-RabbitMQ Net-RabbitMQ-0.2.0/Makefile.PL Net-RabbitMQ-0.2.0/MANIFEST Net-RabbitMQ-0.2.0/META.yml Net-RabbitMQ-0.2.0/RabbitMQ.pm Net-RabbitMQ-0.2.0/RabbitMQ.xs Net-RabbitMQ-0.2.0/README Net-RabbitMQ-0.2.0/t/ Net-RabbitMQ-0.2.0/typemap Net-RabbitMQ-0.2.0/t/001_declare_exchange.t Net-RabbitMQ-0.2.0/t/002_publish.t Net-RabbitMQ-0.2.0/t/003_consume.t Net-RabbitMQ-0.2.0/t/004_selfconsume.t Net-RabbitMQ-0.2.0/t/005_noack.t Net-RabbitMQ-0.2.0/t/006_txn.t Net-RabbitMQ-0.2.0/t/007_get.t Net-RabbitMQ-0.2.0/t/008_queue_declare.t Net-RabbitMQ-0.2.0/t/009_no_route.t Net-RabbitMQ-0.2.0/t/010_qos.t Net-RabbitMQ-0.2.0/t/011_hearbeat.t Net-RabbitMQ-0.2.0/t/012_timeout.t CPAN: File::Temp loaded ok (v0.22) CPAN.pm: Going to build J/JE/JESUS/Net-RabbitMQ-0.2.0.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Net::RabbitMQ cp RabbitMQ.pm blib/lib/Net/RabbitMQ.pm /usr/bin/perl /usr/local/share/perl/5.10.1/ExtUtils/xsubpp -typemap /usr/share/perl/5.10/ExtUtils/typemap -typemap typemap RabbitMQ.xs > RabbitMQ.xsc && mv RabbitMQ.xsc RabbitMQ.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" RabbitMQ.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" amqp_api.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" amqp_connection.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" amqp_debug.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" amqp_framing.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" amqp_mem.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" amqp_socket.c cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.2.0\" -DXS_VERSION=\"0.2.0\" -fPIC "-I/usr/lib/perl/5.10/CORE" amqp_table.c Running Mkbootstrap for Net::RabbitMQ () chmod 644 RabbitMQ.bs rm -f blib/arch/auto/Net/RabbitMQ/RabbitMQ.so cc -shared -O2 -g -L/usr/local/lib -fstack-protector RabbitMQ.o amqp_api.o amqp_connection.o amqp_debug.o amqp_framing.o amqp_mem.o amqp_socket.o amqp_table.o -o blib/arch/auto/Net/RabbitMQ/RabbitMQ.so \ \ chmod 755 blib/arch/auto/Net/RabbitMQ/RabbitMQ.so cp RabbitMQ.bs blib/arch/auto/Net/RabbitMQ/RabbitMQ.bs chmod 644 blib/arch/auto/Net/RabbitMQ/RabbitMQ.bs Manifying blib/man3/Net::RabbitMQ.3pm JESUS/Net-RabbitMQ-0.2.0.tar.gz /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/001_declare_exchange.t .. ok t/002_publish.t ........... 5/8 and hangs here I have installed 1.7.2-1ubuntu1 version of rabbitmq server
I am also having the same issue with the 0.2.0 and 0.1.9 release. I also have a similar issue with the 003.consume.t test hanging on releases 0.1.7 and 0.1.8. Could this be caused by changes made to rabbitmq in newer versions?
From: Aaron Schrab
On Wed Apr 27 12:07:53 2011, piotr_poznanski@o2.pl wrote: Show quoted text
> Hello, > I tried it both on ubutnu desktop and server 32bits (running under > vmware) 10.04 LTS, and I can see that in both cases installation hangs > on t/002_publish.t (after sometimes 3 or 5 or 6 tests done) > > I'm trying to install: (cpan -i) Net-RabbitMQ-0.2.0 > perl vesrion: v5.10.1 (*) built for i486-linux-gnu-thread-multi > OS: server: Linux ubuntu 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 > 18:24:35 UTC 2011 i686 GNU/Linux > desktop: Linux ubuntu 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 > 23:52:12 UTC 2010 i686 GNU/Linux
I also had a problem with the installation hanging. Other tests failed for me. I believe that the patch that I'm attaching at least gets the tests to a state where they can be at least semi-reliable. Many tests are still using fixed queue names and default to a public server, these will likely fail if multiple people are running them against that public server at the same time. But, this should still be an improvement. This problem can be avoided by setting the $MQHOST environment variable to point to a different RabbitMQ server. I couldn't think of a portable way to do the timeout tests, so I just set those to be skipped. The changes from this patch are also available as a series of commits in my github repository: https://github.com/aschrab/perl-Net--RabbitMQ/commits/tests
Subject: Net_RabbitMQ.tests.patch
diff --git a/t/002_publish.t b/t/002_publish.t index a4a098f..fda6d05 100644 --- a/t/002_publish.t +++ b/t/002_publish.t @@ -16,7 +16,7 @@ eval { $mq->queue_declare(1, "nr_test_hole", { passive => 0, durable => 1, exclu is($@, '', "queue_declare"); eval { $mq->queue_bind(1, "nr_test_hole", "nr_test_x", "nr_test_route"); }; is($@, '', "queue_bind"); -eval { 1 until($mq->get(1, "nr_test_hole")); }; +eval { 1 while($mq->get(1, "nr_test_hole")); }; is($@, '', "drain queue"); eval { $mq->publish(1, "nr_test_route", "Magic Payload", { exchange => "nr_test_x" }, @@ -28,7 +28,7 @@ eval { $mq->publish(1, "nr_test_route", "Magic Payload", expiration => 'later', message_id => 'ABC', type => 'notmytype', - user_id => 'yoda', + user_id => 'guest', app_id => 'idd', delivery_mode => 1, priority => 2, diff --git a/t/003_consume.t b/t/003_consume.t index 536ac38..e021962 100644 --- a/t/003_consume.t +++ b/t/003_consume.t @@ -35,7 +35,7 @@ is_deeply($rv, expiration => 'later', message_id => 'ABC', type => 'notmytype', - user_id => 'yoda', + user_id => 'guest', app_id => 'idd', delivery_mode => 1, priority => 2, diff --git a/t/007_get.t b/t/007_get.t index 2cb5174..e498c39 100644 --- a/t/007_get.t +++ b/t/007_get.t @@ -52,7 +52,7 @@ eval { $mq->publish(1, "nr_test_q", "Magic Transient Payload 2", expiration => 'later', message_id => 'ABC', type => 'notmytype', - user_id => 'yoda', + user_id => 'guest', app_id => 'idd', delivery_mode => 1, priority => 2, @@ -79,7 +79,7 @@ is_deeply($getr, expiration => 'later', message_id => 'ABC', type => 'notmytype', - user_id => 'yoda', + user_id => 'guest', app_id => 'idd', delivery_mode => 1, priority => 2, diff --git a/t/011_hearbeat.t b/t/011_hearbeat.t index 6477ab5..99e9c7d 100644 --- a/t/011_hearbeat.t +++ b/t/011_hearbeat.t @@ -1,4 +1,4 @@ -use Test::More tests => 6; +use Test::More tests => 7; use strict; use Data::Dumper; @@ -9,21 +9,23 @@ use_ok('Net::RabbitMQ'); my $mq = Net::RabbitMQ->new(); ok($mq); -eval { $mq->connect($host, { user => "guest", password => "guest", heartbeat => 1 }); }; +eval { $mq->connect($host, { user => "guest", password => "guest", heartbeat => 10 }); }; is($@, '', "connect"); eval { $mq->channel_open(1); }; is($@, '', "channel_open"); +diag "Sleeping for 5 seconds"; sleep(5); eval { $mq->heartbeat(); }; is($@, '', "heartbeat"); $mq->basic_return(sub { my ($channel, $m) = @_; - print Dumper(\@_); + diag Dumper(\@_); }); my $rv = 0; eval { $rv = $mq->publish(1, "nr_test_q", "Magic Transient Payload", { exchange => "nr_test_x", "immediate" => 1, "mandatory" => 1 }); }; is($rv, 0, "publish"); -sleep(1); +diag "Sleeping for 30 seconds"; +sleep(30); eval { $rv = $mq->publish(1, "nr_test_q", "Magic Transient Payload", { exchange => "nr_test_x", "immediate" => 1, "mandatory" => 1 }); }; is($rv, -1, "publish"); diff --git a/t/012_timeout.t b/t/012_timeout.t index 08f23c6..295a78e 100644 --- a/t/012_timeout.t +++ b/t/012_timeout.t @@ -1,4 +1,4 @@ -use Test::More tests => 4; +use Test::More skip_all => "No portable way to ensure connection timeout", tests => 4; use strict; use Time::HiRes qw/gettimeofday tv_interval/;