[SCM] Debian packaging of libio-async-perl branch, master, updated. debian/0.51-2-15-g04b564a
gregor herrmann
gregoa at debian.org
Wed Aug 15 16:15:22 UTC 2012
The following commit has been merged in the master branch:
commit c9312eb90d01c38ee6c76855c1c8e6259032d12c
Author: gregor herrmann <gregoa at debian.org>
Date: Wed Aug 15 17:46:11 2012 +0200
Add patch subsecond.patch, backported from upstream:
subsecond timer tests are skipped unless unit-tests require them, since they
are not reliable for all Loop implementations.
Thanks: Paul "LeoNerd" Evans (upstream author) for pointing me to the fix.
Closes: #680790
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..409bbeb
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+subsecond.patch
diff --git a/debian/patches/subsecond.patch b/debian/patches/subsecond.patch
new file mode 100644
index 0000000..a80d8ce
--- /dev/null
+++ b/debian/patches/subsecond.patch
@@ -0,0 +1,73 @@
+Origin: upstream, http://bazaar.leonerd.org.uk/perl/IO-Async/, r1044
+Bug: https://rt.cpan.org/Ticket/Display.html?id=78892
+Bug-Debian: http://bugs.debian.org/680790
+Reviewed-by: gregor herrmann <gregoa at debian.org>
+Applied-Upstream: yes, in bzr and since 0.51_001
+
+revno 1044
+From: Paul "LeoNerd" Evans <leonerd at leonerd.org.uk>
+Date: Tue 2012-06-26 23:58:58 +0100
+Branch-Nick: IO-Async
+Subject: Allow Loops to declare for unit-test purposes that they can't
+ handle subsecond timers accurately, so skip the counter tests
+
+---
+ lib/IO/Async/Loop.pm | 4 ++++
+ lib/IO/Async/LoopTests.pm | 32 ++++++++++++++++++--------------
+ 2 files changed, 22 insertions(+), 14 deletions(-)
+
+--- a/lib/IO/Async/Loop.pm
++++ b/lib/IO/Async/Loop.pm
+@@ -16,6 +16,10 @@
+ # Base value but some classes might override
+ use constant _CAN_ON_HANGUP => 0;
+
++# Some Loop implementations do not accurately handle sub-second timers.
++# This only matters for unit tests
++use constant _CAN_SUBSECOND_ACCURATELY => 1;
++
+ use Carp;
+
+ use IO::Socket (); # empty import
+--- a/lib/IO/Async/LoopTests.pm
++++ b/lib/IO/Async/LoopTests.pm
+@@ -464,21 +464,25 @@
+ }
+ } 1.5, 2.5, 'loop_once(5) while waiting for timer';
+
+- # Check that short delays are achievable in one ->loop_once call
+- foreach my $delay ( 0.001, 0.01, 0.1 ) {
+- my $done;
+- my $count = 0;
+- my $start = time;
+-
+- $loop->enqueue_timer( delay => $delay, code => sub { $done++ } );
+-
+- while( !$done ) {
+- $loop->loop_once( 1 );
+- $count++;
+- last if time - $start > 5; # bailout
+- }
++ SKIP: {
++ skip "Unable to handle sub-second timers accurately", 3 unless $loop->_CAN_SUBSECOND_ACCURATELY;
++
++ # Check that short delays are achievable in one ->loop_once call
++ foreach my $delay ( 0.001, 0.01, 0.1 ) {
++ my $done;
++ my $count = 0;
++ my $start = time;
++
++ $loop->enqueue_timer( delay => $delay, code => sub { $done++ } );
+
+- is( $count, 1, "One ->loop_once(1) sufficient for a single $delay second timer" );
++ while( !$done ) {
++ $loop->loop_once( 1 );
++ $count++;
++ last if time - $start > 5; # bailout
++ }
++
++ is( $count, 1, "One ->loop_once(1) sufficient for a single $delay second timer" );
++ }
+ }
+
+ $cancelled_fired = 0;
--
Debian packaging of libio-async-perl
More information about the Pkg-perl-cvs-commits
mailing list