Bugzilla – Attachment 49179 Details for
Bug 16044
Define a L1 cache for all objects set in cache
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16044: Make tests from t/Cache.t pass
Bug-16044-Make-tests-from-tCachet-pass.patch (text/plain), 1.71 KB, created by
Jonathan Druart
on 2016-03-15 15:48:29 UTC
(
hide
)
Description:
Bug 16044: Make tests from t/Cache.t pass
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-15 15:48:29 UTC
Size:
1.71 KB
patch
obsolete
>From 4243378291687b2c5908907f5a57628f5bbdba6d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 15 Mar 2016 15:45:20 +0000 >Subject: [PATCH] Bug 16044: Make tests from t/Cache.t pass > >The timeout does not impact the L1 cache (it would be to time consuming >and not really useful to do that for this cache). >To simulate the real timeout, we need to flush this L1 cache when >needed. >It would be also done adding a disable_L1_cache method. >--- > t/Cache.t | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/t/Cache.t b/t/Cache.t >index 4c50a2b..0548a62 100644 >--- a/t/Cache.t >+++ b/t/Cache.t >@@ -43,6 +43,7 @@ SKIP: { > # test expiry time in cache > $cache->set_in_cache( "timeout", "I AM DATA", 1 ); # expiry time of 1 second > sleep 2; >+ $cache->flush_L1_cache(); > is( $cache->get_from_cache("timeout"), > undef, "fetching expired item from cache" ); > >@@ -88,7 +89,9 @@ SKIP: { > ); > ok( defined($myscalar), 'Created tied scalar' ); > is( $$myscalar, 1, 'Constructor called to first initialize' ); >+ $cache->flush_L1_cache(); > is( $$myscalar, 1, 'Data retrieved from cache' ); >+ $cache->flush_L1_cache(); > sleep 2; > is( $$myscalar, 2, 'Constructor called again when timeout reached' ); > $$myscalar = 5; >@@ -119,6 +122,7 @@ SKIP: { > is($myhash->{'key2'}, 'surprise', 'Setting hash member worked'); > $hash{'key2'} = 'nosurprise'; > sleep 2; >+ $cache->flush_L1_cache(); > is($myhash->{'key2'}, 'nosurprise', 'Cache change caught'); > > >@@ -134,6 +138,7 @@ SKIP: { > $hash{'anotherkey'} = 'anothervalue'; > > sleep 2; >+ $cache->flush_L1_cache(); > > ok(exists $myhash->{'anotherkey'}, 'Cache reset properly'); > >-- >2.7.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16044
:
48968
|
49179
|
49186
|
49187
|
49188
|
49239
|
49240
|
49490
|
49491
|
49492
|
49493
|
49494
|
49545
|
49546
|
49547
|
49548
|
49549
|
49555
|
49568
|
49647