Subject: | Test failure in t/04_reconnect.t |
Date: | Mon, 02 Dec 2013 00:21:46 +0200 |
To: | bugs-AnyEvent-Gearman [...] rt.cpan.org |
From: | Marius Gavrilescu <marius [...] ieval.ro> |
Hello AnyEvent::Gearman maintainers.
I am packaging this module for Debian, but one of the tests in
t/04_reconnect.t is failing. The make test output is:
PERL_DL_NONLAZY=3D1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harn=
ess(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t
t/00_compile.t ........ 1/? # Soft dependency versions:
# Any::Moose: 0.21
# Mouse: 1.12
t/00_compile.t ........ ok=20=20=20
t/01_api.t ............ ok=20=20=20
t/02_client_worker.t .. ok=20=20=20
t/03_simple.t ......... ok=20=20=20
t/04_reconnect.t ...... 1/? Connection failed: Connection refused at /home/=
marius/AnyEvent-Gearman-0.10/blib/lib/AnyEvent/Gearman/Connection.pm line 1=
12.
# Failed test 'sum ok'
# at t/04_reconnect.t line 59.
# got: 'fail'
# expected: '8'
# Looks like you failed 1 test of 5.
Unable to initialize connection to gearmand at /usr/share/perl5/Gearman/Wor=
ker.pm line 116.
t/04_reconnect.t ...... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/5 subtests=20
t/05_prefix.t ......... ok=20=20=20
t/09_constants.t ...... ok=20=20=20=20=20
Test Summary Report
-------------------
t/04_reconnect.t (Wstat: 256 Tests: 5 Failed: 1)
Failed test: 5
Non-zero exit status: 1
Files=3D7, Tests=3D58, 7 wallclock secs ( 0.07 usr 0.01 sys + 1.21 cusr =
0.14 csys =3D 1.43 CPU)
Result: FAIL
Failed 1/7 test programs. 1/58 subtests failed.
make: *** [test_dynamic] Error 255
I have worked around this bug by adding a sleep statement, as seen in
this patch:
Description: Fix t/04_reconnect.t
The reconnect test fails due to a race condition. This patch sleeps for
7 seconds (randomly chosen), and the test passes.
Author: Marius Gavrilescu <marius@ieval.ro>
Forwarded: no
Last-Update: 2013-10-24
--- a/t/04_reconnect.t
+++ b/t/04_reconnect.t
@@ -43,6 +43,7 @@
ok !$js->connected, 'disconnect ok';
$js->dead_time(0); # trick for reconnect soon
+ sleep 7;
}
{
This is definitely an inelegant solution. I am therefore looking for a
better one, what would you suggest?
--
Marius Gavrilescu
Message body not shown because it is not plain text.