summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-03-07 18:44:59 -0800
committerDaniel Pittman <daniel@rimspace.net>2011-03-07 18:44:59 -0800
commitc3ec3d100fb27211bf86c12bdc759d1fa1afce25 (patch)
tree7a175e70442c4ead4285ffc4538a7b06a48c53e2 /spec
parent28095d7435bcab15b76ddfa4435d61653f2f890d (diff)
parent9a1c3b5ad48a254ff2a6becc72f54feb37bb3de1 (diff)
downloadpuppet-c3ec3d100fb27211bf86c12bdc759d1fa1afce25.tar.gz
puppet-c3ec3d100fb27211bf86c12bdc759d1fa1afce25.tar.xz
puppet-c3ec3d100fb27211bf86c12bdc759d1fa1afce25.zip
Merge branch 'maint/refs/heads/next/MAINT-spec-integration-configurer-has-races-in-time-checking' into next
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/configurer_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/integration/configurer_spec.rb b/spec/integration/configurer_spec.rb
index 825b6322e..05b3d6146 100755
--- a/spec/integration/configurer_spec.rb
+++ b/spec/integration/configurer_spec.rb
@@ -50,7 +50,12 @@ describe Puppet::Configurer do
Puppet[:lastrunfile] = tmpfile("lastrunfile")
Puppet[:report] = true
+ # We only record integer seconds in the timestamp, and truncate
+ # backwards, so don't use a more accurate timestamp in the test.
+ # --daniel 2011-03-07
+ t1 = Time.now.tv_sec
@configurer.run :catalog => @catalog, :report => report
+ t2 = Time.now.tv_sec
summary = nil
File.open(Puppet[:lastrunfile], "r") do |fd|
@@ -62,7 +67,7 @@ describe Puppet::Configurer do
summary.should be_key(key)
end
summary["time"].should be_key("notify")
- summary["time"]["last_run"].should >= Time.now.tv_sec
+ summary["time"]["last_run"].should be_between(t1, t2)
end
end
end