On 2018-12-06 11:38:52, BIGFOOT wrote:
Show quoted text> > Now it passes on the previously failing freebsd systems (10 + 11),
> > but
> > it fails now with freebsd 12 + 13. A sample report:
>
> Wow, fun stuff. I'm not sure I necessarily believe that the version
> of freebsd 12/13 is the issue - but I do not have access to those
> distros at the moment. My inclination is that my test is bad?
>
> Oddly though the diagnostics tell me that the expiration date and
> current time are exactly 5 seconds apart (still exactly within the
> valid token time window) - which means that when is_token_expired()
> did the same conversions the time left should be 5s. If this were a
> timing issue I would have expected the diagnostics to tell me the diff
> between expiration time and current time was > 5 seconds.
>
> # $VAR1 = [
> # '2018-12-06T03:52:14Z',
> # '2018-12-06T03:47:09Z'
> # ];
>
>
> ...so almost certainly I must be seeing some drift from timegm()?
>
> Any chance you can run this little snippet in those problem envs?
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use Time::Local;
> use POSIX::strptime qw/strptime/;
> use Date::Format;
>
> # notes:
> # - expect UTC == GMT, EDT <> UTC
> # - UTC is not really time zone, so maybe issue on some platforms,
> better to use GMT?
> # - EDT should not be the same since my ISO8610 is Zulu time...just
> for sanity
>
> foreach my $tz (qw/UTC GMT EDT/) {
> my $time = time;
> my $iso8610 = time2str("%Y-%m-%dT%H:%M:%SZ", $time, $tz);
> my $timegm = timegm(strptime($iso8610, "%Y-%m-%dT%H:%M:%S%z"));
>
> printf("TZ: %s ISO8601: %s\ntime: %d\ntimegm: %d\n%s\n", $tz,
> $iso8610, $time, $timegm, '-'x60);
> }
>
> ...if not I will add some additional diagnostics and a debug flag for
> testing
The test script surely returns something unexpected on freebsd 12 + 13:
TZ: UTC ISO8601: 2018-12-08T15:30:26Z
time: 1544283026
timegm: 976289426
------------------------------------------------------------
TZ: GMT ISO8601: 2018-12-08T15:30:26Z
time: 1544283026
timegm: 976289426
------------------------------------------------------------
TZ: EDT ISO8601: 2018-12-08T11:30:26Z
time: 1544283026
timegm: 976275026
------------------------------------------------------------
It seems that the year field in the strptime output is broken. Here a working strptime on freebsd 11:
$ perl -MPOSIX::strptime=strptime -e 'warn join ",", strptime("2018-12-10T10:10:10Z", "%Y-%m-%dT%H:%M:%S%z")'
10,10,10,10,11,118,6,341, at -e line 1.
Here the bad output on freebsd 12:
$ perl -MPOSIX::strptime=strptime -e 'warn join ",", strptime("2018-12-10T10:10:10Z", "%Y-%m-%dT%H:%M:%S%z")'
10,10,10,10,11,,6,341, at -e line 1.
Show quoted text>
> On Thu Dec 06 01:46:24 2018, SREZIC wrote:
> > Now it passes on the previously failing freebsd systems (10 + 11),
> > but
> > it fails now with freebsd 12 + 13. A sample report:
> >
http://www.cpantesters.org/cpan/report/9cf0f234-f921-11e8-9416-
> > c1ac4f889b37
> >
> > On 2018-12-05 22:05:57, BIGFOOT wrote:
> > > Yes, that's the working theory - I've uploaded a new version 1.0.8
> > > which I believe addresses the root cause - incorrect parsing of the
> > > ISO8601 date format using strptime(). Let's see how this one
> > > fares.
> > >
> > > On Wed Dec 05 17:25:15 2018, SREZIC wrote:
> > > > Maybe it's timezone related? I just tried setting TZ=UTC
> > > > (originally
> > > > the freebsd10 system has Europe/Berlin configured), and now the
> > > > tests
> > > > pass...
> > > >
> > > > On 2018-12-05 16:29:34, BIGFOOT wrote:
> > > > > Hmm..yes I saw that..puzzling as the test works on other
> > > > > versions
> > > > > and
> > > > > distros from what I can see in the test reports. The test
> > > > > attempts
> > > > > to
> > > > > determine if a token has timed out by looking at the token
> > > > > expiration
> > > > > time compared to the current time. I'll take a closer look at
> > > > > how
> > > > > my
> > > > > comparisons are being done and why it appears that it is busted
> > > > > only
> > > > > on versions > 5.20.0 and only on freebsd.
> > > > >
> > > > > Puzzling indeed.
> > > > >
> > > > >
> > > > > On Wed Dec 05 16:20:02 2018, SREZIC wrote:
> > > > > > On my freebsd10 and freebsd11 smokers t/02-credentials.t
> > > > > > fails:
> > > > > >
> > > > > > ...
> > > > > > # Failed test 'is_token_expired() - no?'
> > > > > > # at t/02-credentials.t line 72.
> > > > > >
> > > > > > # Failed test 'refresh_token()'
> > > > > > # at t/02-credentials.t line 94.
> > > > > > # Looks like you failed 2 tests of 6.
> > > > > > t/02-credentials.t ..
> > > > > > Dubious, test returned 2 (wstat 512, 0x200)
> > > > > > Failed 2/6 subtests
> > > > > > ...