This is an automated email from the git hooks/post-receive script. ntyni pushed a commit to branch master in repository libcache-cache-perl.
commit 3f8df94c1bbc308de2e78b3413d46ee171343acb Author: Niko Tyni <nt...@debian.org> Date: Tue Apr 28 22:15:35 2015 +0300 Drop 0001-Make-tests-aware-of-running-time.patch, applied upstream --- .../0001-Make-tests-aware-of-running-time.patch | 147 --------------------- debian/patches/series | 1 - 2 files changed, 148 deletions(-) diff --git a/debian/patches/0001-Make-tests-aware-of-running-time.patch b/debian/patches/0001-Make-tests-aware-of-running-time.patch deleted file mode 100644 index 9e1a0c8..0000000 --- a/debian/patches/0001-Make-tests-aware-of-running-time.patch +++ /dev/null @@ -1,147 +0,0 @@ -Bugs-Debian: https://bugs.debian.org/766102 -Bugs: https://rt.cpan.org/Public/Bug/Display.html?id=88418 - -From 847184c72a9e76612cd76e97b676af85202be27c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> -Date: Thu, 26 Jun 2014 13:43:09 +0200 -Subject: [PATCH] Make tests aware of running time -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Some tests could fail if they run slower then the tested time limits -because then caches entries expired on different place than expected. This -patch skips such tests if the running time is not shorter than -expected. - -CPAN RT#88418 - -Signed-off-by: Petr Písař <ppi...@redhat.com> ---- - lib/Cache/CacheTester.pm | 30 ++++++++++++++++++++++++------ - lib/Cache/SizeAwareCacheTester.pm | 25 +++++++++++++++++++++---- - 2 files changed, 45 insertions(+), 10 deletions(-) - -diff --git a/lib/Cache/CacheTester.pm b/lib/Cache/CacheTester.pm -index 8f64577..1cd6f82 100644 ---- a/lib/Cache/CacheTester.pm -+++ b/lib/Cache/CacheTester.pm -@@ -168,12 +168,18 @@ sub _test_four - - my $value = 'Test Value'; - -+ my $start = time; - $cache->set( $key, $value, $expires_in ); - - my $fetched_value = $cache->get( $key ); - -- ( $fetched_value eq $value ) ? -- $self->ok( ) : $self->not_ok( '$fetched_value eq $value' ); -+ if (time - $start < $expires_in) { -+ ( $fetched_value eq $value ) ? -+ $self->ok( ) : $self->not_ok( '$fetched_value eq $value' ); -+ } else { -+ $self->skip( '$fetched_value eq $value (not finished in ' . -+ $expires_in . ' s)' ); -+ } - - sleep( $EXPIRES_DELAY + 1 ); - -@@ -460,12 +466,18 @@ sub _test_thirteen - - my $value = 'Test Value'; - -+ my $start = time; - $cache->set( $key, $value, $expires_in ); - - my $fetched_value = $cache->get( $key ); - -- ( $fetched_value eq $value ) ? -- $self->ok( ) : $self->not_ok( '$fetched_value eq $value' ); -+ if (time - $start < $expires_in) { -+ ( $fetched_value eq $value ) ? -+ $self->ok( ) : $self->not_ok( '$fetched_value eq $value' ); -+ } else { -+ $self->skip( '$fetched_value eq $value (not finished in ' . -+ $expires_in . ' s)' ); -+ } - - sleep( $EXPIRES_DELAY + 1 ); - -@@ -525,12 +537,18 @@ sub _test_fifteen - - my $value = 'Test Value'; - -+ my $start = time; - $cache->set( $key, $value, $expires_in ); - - my $fetched_value = $cache->get( $key ); - -- ( $fetched_value eq $value ) ? -- $self->ok( ) : $self->not_ok( '$fetched_value eq $value' ); -+ if (time - $start < $expires_in) { -+ ( $fetched_value eq $value ) ? -+ $self->ok( ) : $self->not_ok( '$fetched_value eq $value' ); -+ } else { -+ $self->skip( '$fetched_value eq $value (not finished in ' . -+ $expires_in . ' s)' ); -+ } - - sleep( $EXPIRES_DELAY + 1 ); - -diff --git a/lib/Cache/SizeAwareCacheTester.pm b/lib/Cache/SizeAwareCacheTester.pm -index 1a660f7..b2bcb79 100644 ---- a/lib/Cache/SizeAwareCacheTester.pm -+++ b/lib/Cache/SizeAwareCacheTester.pm -@@ -110,6 +110,7 @@ sub _test_two - - my $first_expires_in = 20; - -+ my $start = time; - $cache->set( $first_key, $value, $first_expires_in ); - - my $first_size = $cache->size( ); -@@ -129,11 +130,17 @@ sub _test_two - - $cache->set( $key, $value, $second_expires_in ); - } -+ my $second_inserted = time; - - my $second_size = $cache->size( ); - -- ( $second_size > $first_size ) ? -- $self->ok( ) : $self->not_ok( '$second_size > $first_size' ); -+ if (time - $start < $first_expires_in ) { -+ ( $second_size > $first_size ) ? -+ $self->ok( ) : $self->not_ok( '$second_size > $first_size' ); -+ } else { -+ $self->skip( '$second_size > $first_size (not finished in ' . -+ $first_expires_in . ' s)'); -+ } - - my $size_limit = $first_size; - -@@ -146,8 +153,18 @@ sub _test_two - - my $first_value = $cache->get( $first_key ); - -- ( $first_value eq $value ) ? -- $self->ok( ) : $self->not_ok( '$first_value eq $value' ); -+ if (time - $start >= $first_expires_in) { -+ $self->skip( '$first_value eq $value (not finished in ' . -+ $first_expires_in . ' s)'); -+ } elsif ($second_inserted + $second_expires_in >= -+ $start + $first_expires_in) { -+ $self->skip( '$first_value eq $value (second key insterted to late, ' . -+ 'so first key had expiration time before the second one, ' . -+ 'thus the first key was removed when limit cache size'); -+ } else { -+ ( $first_value eq $value ) ? -+ $self->ok( ) : $self->not_ok( '$first_value eq $value' ); -+ } - - } - --- -1.9.3 - diff --git a/debian/patches/series b/debian/patches/series index d9abf2e..3175d99 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1 @@ use-Digest-SHA.patch -0001-Make-tests-aware-of-running-time.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcache-cache-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits