summaryrefslogtreecommitdiffstats
path: root/spec/unit/indirector
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-07-21 11:53:06 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-08-19 13:52:56 -0700
commit49d1e9da1381c77a3873965bad36ba6b33316882 (patch)
tree147dba943b19d1fce68c111422de5f4df2ec3cf5 /spec/unit/indirector
parent9849d565ec4db6bf1a39413c3136da9713f9fa25 (diff)
downloadpuppet-49d1e9da1381c77a3873965bad36ba6b33316882.tar.gz
puppet-49d1e9da1381c77a3873965bad36ba6b33316882.tar.xz
puppet-49d1e9da1381c77a3873965bad36ba6b33316882.zip
Rework Puppet::Util::Cacher to only expire using TTLs
We have removed every usage of cached_attr in which the attribute needs to be manually expired. Thus, the only meaningful behavior provided by Puppet::Util::Cacher is expiration based on TTLs. This commit reworks the cacher to only support that behavior. Rather than accepting an options hash, of which :ttl is the only available option, cached_attr now requires a second argument, which is the TTL. TTLs are now used to compute expirations, which are stored and used for expiring values. Previously, we stored a timestamp and used it and the TTL to determine whether the attribute was expired. This had the potentially undesirable side effect that the lifetime of a cached attribute could be extended after its insertion by modifying the TTL setting for the cache. Now, the lifetime of an attribute is determined when it is set, and is thereafter immutable, aside from deliberately re-setting the expiration for that particular attribute. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit d198fedf65e472b384666fc9ae3bef487852068a) Conflicts: spec/integration/node/facts_spec.rb spec/unit/node_spec.rb
Diffstat (limited to 'spec/unit/indirector')
-rwxr-xr-xspec/unit/indirector/indirection_spec.rb4
1 files changed, 0 insertions, 4 deletions
diff --git a/spec/unit/indirector/indirection_spec.rb b/spec/unit/indirector/indirection_spec.rb
index 4bbc855b1..c33fdf165 100755
--- a/spec/unit/indirector/indirection_spec.rb
+++ b/spec/unit/indirector/indirection_spec.rb
@@ -102,9 +102,6 @@ shared_examples_for "Delegation Authorizer" do
end
describe Puppet::Indirector::Indirection do
- after do
- Puppet::Util::Cacher.expire
- end
describe "when initializing" do
# (LAK) I've no idea how to test this, really.
it "should store a reference to itself before it consumes its options" do
@@ -643,7 +640,6 @@ describe Puppet::Indirector::Indirection do
after :each do
@indirection.delete
- Puppet::Util::Cacher.expire
end
end