diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-31 22:47:01 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-31 22:47:01 +0000 |
| commit | d467e18bc66b124dc4950cb4442d0d67ed4c573f (patch) | |
| tree | 934a1371439b929065e78541093981538fcf914c /test/network/client/master.rb | |
| parent | e8097a2fc1318829b31b4cb3e4b076db30696ef7 (diff) | |
| download | puppet-d467e18bc66b124dc4950cb4442d0d67ed4c573f.tar.gz puppet-d467e18bc66b124dc4950cb4442d0d67ed4c573f.tar.xz puppet-d467e18bc66b124dc4950cb4442d0d67ed4c573f.zip | |
Fixing #532 -- reparsing config files no longer throws an exception. The problem only occurred when reparsing a configuration file that was also being managed (which was common) and only whent the manifest was up to date (the combination was uncommon). Reparsing would find the existing file object and use it to check permissions and such, then it would remove all of the internal data in the object, for cleanup; the problem is, the client still had a reference to the object, so when it went to run its configuration, this broken reference was used.
The solution I chose was to remove all objects from memory after every run. It is negligible to reload them from the cache, and it saves ram for the 99% of the time that the client is just sitting there. And it makes this problem go away. :)
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2545 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/network/client/master.rb')
| -rwxr-xr-x | test/network/client/master.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb index edd91cf30..64ff34314 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -706,6 +706,23 @@ end client.send(:splay) end end + + # This is partially to fix #532, but also to save on memory. + def test_remove_objects_after_every_run + client = mkclient + + ftype = Puppet::Type.type(:file) + + assert_nil(ftype[@createdfile], "file object already exists") + assert(! FileTest.exists?(@createdfile), "File already exists on disk") + + assert_nothing_raised("Could not apply config") do + client.run + end + + assert(FileTest.exists?(@createdfile), "File does not exist on disk") + assert_nil(ftype[@createdfile], "file object was not removed from memory") + end end # $Id$ |
