Skip Menu |

This queue is for tickets about the CHI CPAN distribution.

Report information
The Basics
Id: 120705
Status: new
Priority: 0/
Queue: CHI

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.60
Fixed in: (no value)



Subject: t/smoke-Driver-FastMmap.t test fails with Cache-FastMmap-1.45
Cache-FastMmap-1.45 depreacted raw_values option: Revision history for Perl extension Cache::FastMmap. 1.45 Thu Mar 14 11:10 2017 - Deprecate raw_values and compress options, add new compressor and serializer options to allow different compressors and serializers. Initial compressor support: zlib, lz4, snappy Initial serializer support: storable, sereal, json Thanks to nickt@broadbean.com for initial work and thus after upgrading Cache-FastMmap from 1.44 to 1.45, t/smoke-Driver-FastMmap.t test fails: t/smoke-Driver-CacheCache.t ............. ok # Failed test 'raw_values = 1 by default' # at /builddir/build/BUILD/CHI-0.60/blib/lib/CHI/t/Driver/FastMmap.pm line 41. # (in CHI::t::Driver::FastMmap->test_fm_cache) # got: '0' # expected: '1' # Looks like you failed 1 test of 832. t/smoke-Driver-FastMmap.t ............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/832 subtests (less 1 skipped subtest: 830 okay)
From: ppisar [...] redhat.com
Dne Čt 23.bře.2017 06:09:08, ppisar napsal(a): Show quoted text
> Cache-FastMmap-1.45 depreacted raw_values option: >
Attached patch fixes it.
Subject: 0001-Adapt-to-changes-in-Cache-FastMmap-1.45.patch
From 8513c82bca186a9c724fe9c9b44ccbac062793d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Wed, 3 May 2017 16:57:52 +0200 Subject: [PATCH] Adapt to changes in Cache-FastMmap-1.45 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cache-FastMmap-1.45 deprecated raw_values constructor argument in favor of new serializer argument. This changes caused t/smoke-Driver-CacheCache.t to fail. This patch uses serializer with Cache::FastMmap >= 1.45, otherwise the old raw_values. CPAN RT#120705 Signed-off-by: Petr Písař <ppisar@redhat.com> --- lib/CHI/Driver/FastMmap.pm | 10 +++++++--- lib/CHI/t/Driver/FastMmap.pm | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/CHI/Driver/FastMmap.pm b/lib/CHI/Driver/FastMmap.pm index 1b43344..19edcf8 100644 --- a/lib/CHI/Driver/FastMmap.pm +++ b/lib/CHI/Driver/FastMmap.pm @@ -21,7 +21,11 @@ sub BUILD { mkpath( $self->root_dir, 0, $self->dir_create_mode ) if !-d $self->root_dir; $self->{fm_params} = { - raw_values => 1, + ( + ($Cache::FastMmap::VERSION >= 1.45) ? + (serializer => '') : + (raw_values => 1) + ), unlink_on_exit => 0, share_file => catfile( $self->root_dir, @@ -108,8 +112,8 @@ though not between hosts. To support namespaces, this driver takes a directory parameter rather than a file, and creates one Cache::FastMMap file for each namespace. -Because CHI handles serialization automatically, we pass the C<raw_values> flag -as 1; and to conform to the CHI API, we pass C<unlink_on_exit> as 0, so that +Because CHI handles serialization automatically, we pass the C<serializer> flag +as ''; and to conform to the CHI API, we pass C<unlink_on_exit> as 0, so that all cache files are permanent. =head1 CONSTRUCTOR OPTIONS diff --git a/lib/CHI/t/Driver/FastMmap.pm b/lib/CHI/t/Driver/FastMmap.pm index 2339c84..8532804 100644 --- a/lib/CHI/t/Driver/FastMmap.pm +++ b/lib/CHI/t/Driver/FastMmap.pm @@ -35,7 +35,11 @@ sub test_fm_cache : Tests { my %defaults = ( unlink_on_exit => 0, empty_on_exit => 0, - raw_values => 1, + ( + ($Cache::FastMmap::VERSION >= 1.45) ? + (serialize => 0) : + (raw_values => 1) + ), ); while ( my ( $key, $value ) = each(%defaults) ) { is( $fm_cache->{$key} || 0, $value, "$key = $value by default" ); -- 2.7.4