Skip Menu |

This queue is for tickets about the AnyEvent-XMPP CPAN distribution.

Report information
The Basics
Id: 48817
Status: resolved
Priority: 0/
Queue: AnyEvent-XMPP

People
Owner: Nobody in particular
Requestors: toddr [...] cpanel.net
Cc: alexm [...] cpan.org
AdminCc:

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



Subject: Tests fail on 0.5
$>prove -lvm t/datetime.t t/datetime.t .. 1..22 ... ok 13 - no secfrac defined not ok 14 - timestamp is UTC located # Failed test 'timestamp is UTC located' # at t/datetime.t line 31. # got: '1185821500' # expected: '1185813700' ok 15 - new format seconds ... # Looks like you failed 1 test of 22.
Subject: Tests fail on 0.5 in Solaris
From: todd.e.rinaldo [...] jpmorgan.com
Also failing on 0.51 $>perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=solaris, osvers=2.8, archname=sun4-solaris uname='sunos 5.8 generic_117350-38 sun4u sparc sunw,sun-fire-15000 ' config_args='' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='/opt/SUNWspro/bin/cc', ccflags =' -D_LARGEFILE_SOURCE - D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='' ccversion='Sun C 5.8 Patch 121015-02 2006/03/29', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='/opt/SUNWspro/bin/cc', ldflags ='-L/usr/lib -L/usr/ccs/lib - L/opt/SUNWspro/prod/lib/v8plus -L/opt/SUNWspro/prod/lib -L/lib - L/apps/perl/utils/lib ' libpth=/usr/lib /usr/ccs/lib /opt/SUNWspro/prod/lib/v8plus /opt/SUNWspro /prod/lib /lib /apps/perl/utils/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-KPIC', lddlflags='-G -L/usr/lib -L/usr/ccs/lib - L/opt/SUNWspro/prod/lib/v8plus -L/opt/SUNWspro/prod/lib -L/lib - L/apps/perl/utils/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under solaris Compiled at Apr 3 2009 19:10:57 %ENV: PERL5LIB="" PERL5OPT="" PERL5_CPANPLUS_IS_RUNNING="7477" PERL5_CPAN_IS_RUNNING="7477" PERL_HOME="/usr/local/bin/perl5.8.0" PERL_VERS="5.8.0" @INC: .
From: todd.e.rinaldo [...] jpmorgan.com
I suggest this patch. The problem is due to your assumption that the tester doesn't have the TZ environment variable set. diff --git a/t/datetime.t b/t/datetime.t index 2873bdb..c300b98 100644 --- a/t/datetime.t +++ b/t/datetime.t @@ -27,9 +27,13 @@ is (1*$year, 107, "old format year"); ok ((not defined $tz) , "no tz defined"); ok ((not defined $secfrac), "no secfrac defined"); -my $ts = xmpp_datetime_as_timestamp ("20070730T18:51:40-02:10"); -is ($ts, '1185813700', "timestamp is UTC located"); +SKIP: { + skip("This test only works for UTC timezones.",1) if($ENV{TZ} && $ENV{TZ} ne 'UTC'); + + my $ts = xmpp_datetime_as_timestamp ("20070730T18:51:40-02:10"); + is ($ts, '1185813700', "timestamp is UTC located"); +} # new format ($sec, $min, $hour, $mday, $mon, $year, $tz, $secfrac) = from_xmpp_datetime ("03:02:01.123+01:10");
Subject: Re: [rt.cpan.org #48817] Tests fail on 0.5
Date: Wed, 19 Aug 2009 14:36:23 +0200
To: "Todd E. Rinaldo via RT" <bug-AnyEvent-XMPP [...] rt.cpan.org>
From: Robin Redeker <elmex [...] ta-sa.org>
On Tue, Aug 18, 2009 at 08:13:05PM -0400, Todd E. Rinaldo via RT wrote: Show quoted text
> Queue: AnyEvent-XMPP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48817 > > > I suggest this patch. The problem is due to your assumption that the > tester doesn't have the TZ environment variable set. > > diff --git a/t/datetime.t b/t/datetime.t > index 2873bdb..c300b98 100644 > --- a/t/datetime.t > +++ b/t/datetime.t > @@ -27,9 +27,13 @@ is (1*$year, 107, "old format year"); > ok ((not defined $tz) , "no tz defined"); > ok ((not defined $secfrac), "no secfrac defined"); > > -my $ts = xmpp_datetime_as_timestamp ("20070730T18:51:40-02:10"); > -is ($ts, '1185813700', "timestamp is UTC located"); > +SKIP: { > + skip("This test only works for UTC timezones.",1) if($ENV{TZ} && > $ENV{TZ} ne 'UTC'); > > + > + my $ts = xmpp_datetime_as_timestamp ("20070730T18:51:40-02:10"); > + is ($ts, '1185813700', "timestamp is UTC located"); > +} > # new format > ($sec, $min, $hour, $mday, $mon, $year, $tz, $secfrac) > = from_xmpp_datetime ("03:02:01.123+01:10"); >
Hi! Thanks for noticing and the patch. I've got a different fix for this in another branch of AnyEvent::XMPP, I'll merge the fix into the maintenance branch on next release. Thanks! Robin -- Robin Redeker | Deliantra, the free code+content MORPG elmex@ta-sa.org / r.redeker@gmail.com | http://www.deliantra.net http://www.ta-sa.org/ |
Show quoted text
> Thanks for noticing and the patch. I've got a different fix for > this in another branch of AnyEvent::XMPP, I'll merge the fix > into the maintenance branch on next release.
Hi! It's been a long while and the issue still remains making automated installations of AnyEvent::XMPP fail unless tests are skipped. Since patch suggested in bug #62739 solves the issue and it is quite straightforward, could you please make a release? Thanks a lot!
Subject: Re: [rt.cpan.org #48817] Tests fail on 0.5
Date: Thu, 17 Feb 2011 07:43:58 +0100
To: Alex Muntada via RT <bug-AnyEvent-XMPP [...] rt.cpan.org>
From: Robin Redeker <robin [...] nethype.de>
Hi! I think I will see if I can make another maintenance release in the next days. Maybe I should release the next version even (1.x, API incompatible), as I wanted to stop supporting the current 0.x versions... Greetings, Robin Redeker On Tue, Feb 15, 2011 at 05:42:19AM -0500, Alex Muntada via RT wrote: Show quoted text
> Queue: AnyEvent-XMPP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48817 > >
> > Thanks for noticing and the patch. I've got a different fix for > > this in another branch of AnyEvent::XMPP, I'll merge the fix > > into the maintenance branch on next release.
> > Hi! It's been a long while and the issue still remains making > automated installations of AnyEvent::XMPP fail unless tests > are skipped. > > Since patch suggested in bug #62739 solves the issue and it is > quite straightforward, could you please make a release? > > Thanks a lot!
From: toomasp [...] gmx.net
On Thu Feb 17 01:44:55 2011, robin@nethype.de wrote: Show quoted text
> Hi! > > I think I will see if I can make another maintenance release in the > next days. > Maybe I should release the next version even (1.x, API incompatible), > as I > wanted to stop supporting the current 0.x versions... >
Hi again, How far is it until 1.x? Awaiting somewhat impatiently :)
Subject: Re: [rt.cpan.org #48817] Tests fail on 0.5
Date: Fri, 25 Mar 2011 13:17:06 +0100
To: Toomas Pelberg via RT <bug-AnyEvent-XMPP [...] rt.cpan.org>
From: Robin Redeker <elmex [...] ta-sa.org>
Hi! On Fri, Mar 25, 2011 at 06:28:42AM -0400, Toomas Pelberg via RT wrote: Show quoted text
> Queue: AnyEvent-XMPP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48817 > > > On Thu Feb 17 01:44:55 2011, robin@nethype.de wrote:
> > Hi! > > > > I think I will see if I can make another maintenance release in the > > next days. > > Maybe I should release the next version even (1.x, API incompatible), > > as I > > wanted to stop supporting the current 0.x versions... > >
> > Hi again, > > How far is it until 1.x? Awaiting somewhat impatiently :)
I still haven't got around to the release yet (it includes some testing environment i haven't got around setting up yet, and some missing documentation), but you can always check out the code from the git ('connection_ref' branch): git-clone -b connection_ref http://git.ta-sa.org/AnyEvent-XMPP.git The code and api in there is already quite long in my personal production use and examples can be gathered from the test suite (haven't had time to write good examples yet). So the final release will not contain any big changes w.r.t. API. Greetings, Robin -- Robin Redeker | Deliantra, the free code+content MORPG elmex@ta-sa.org / r.redeker@gmail.com | http://www.deliantra.net http://www.ta-sa.org/ |
The test fails because the TZ env var is not correctly set in AnyEvent::XMPP::Util xmpp_datetime_as_timestamp subroutine (the offset should immediately follow the timezone, instead there's a space between it. The following patch makes the test pass for me: diff --git a/lib/AnyEvent/XMPP/Util.pm b/lib/AnyEvent/XMPP/Util.pm index 7faae05..7d9bc92 100644 --- a/lib/AnyEvent/XMPP/Util.pm +++ b/lib/AnyEvent/XMPP/Util.pm @@ -519,7 +519,7 @@ sub xmpp_datetime_as_timestamp { my ($s, $m, $h, $md, $mon, $year, $tz) = from_xmpp_datetime ($string); my $otz = $ENV{TZ}; - $ENV{TZ} = ($tz =~ /^([+-])(\d{2}):(\d{2})$/ ? "UTC $tz" : ""); + $ENV{TZ} = ($tz =~ /^([+-])(\d{2}):(\d{2})$/ ? "UTC$tz" : ""); POSIX::tzset (); my $ts = POSIX::mktime ($s, $m, $h, $md, $mon, $year);
This issue has already been fixed with AnyEvent::XMPP 0.52.