Issue #2511 has been updated by Markus Roberts.

> There's a "require 'puppet/type/file'" in the backups test file. This require 
> is causing the File type to be reloaded after it had already loaded all of 
> its parameters (e.g., :source), and it's another case of Puppet's loading 
> system conflicting with ruby's loading system.

Yeah, I'd gotten that far when I broke for lunch.  My current test rig is:

<pre>
#!/usr/bin/env ruby

require 'test/lib/puppettest'
Kernel.require 'lib/puppet/type/file'
Kernel.require './lib/puppet/type/file'

Puppet::Type.type(:file).new :path => "/something", :title => "other", :content 
=> "blah"
</pre>

Once I'd cleared the brush away enough to see that, a long walk, caffeine & a 
bagel seemed like a good idea.

>  If you remove this require, then I am essentially positive it will fix the 
> problem.

There isn't an explicit require of puppet/type/file that I can find in the lib 
code.  So pulling that out of the backups test would fix the test isolation 
issue, but wouldn't do anything for the harder to reproduce but doubtlessly 
real issue running the app (as opposed to the tests).

Solutions I'm looking at (none of which I"m in love with):

* Instead of an :overwrite => true/false option to the genclass --> genthing 
path, have some sort of find_or_create option that returns the existing 
Class/Module if it's already loaded (but doesn't run the block).
* Some sort of patchup/unification process to make the reloading less traumatic 
(e.g. more like the way ruby behaves) via getting rid of the remove_const on 
conflict.
* Adding something smarter (but hopefully short of full AI) to the load process 
so that it doesn't try to load things twice (though note that my test rig does 
it all with @Kernel.require@).
* Trying to track down the code path that Sam Rowe hit that caused it to 
multiply load in the running app, fixing that, and hoping to heck that it was a 
unique flower, once plucked n'er to bloom again.

As you can see, none of these are wonderful.

-- Markus



----------------------------------------
Bug #2511: Sporadic and spurious "invalid parameter" errors
http://projects.reductivelabs.com/issues/2511

Author: Markus Roberts
Status: Accepted
Priority: High
Assigned to: Markus Roberts
Category: unknown
Target version: 0.25.0
Complexity: Unknown
Affected version: 0.25.0rc1
Keywords: 


Under certain orderings large numbers (>100) of tests will fail with messages 
similar to this:

<pre>
44)
Puppet::Error in 'Puppet::Resource::Catalog when compiling when creating a 
relationship graph should not write graph files if the catalog is not a host 
cata
log'
Invalid parameter source(:source)
./lib/puppet/util/errors.rb:51:in `fail'
./lib/puppet/type.rb:418:in `[]'
./spec/../lib/puppet/type/file.rb:278:in `validate'
./lib/puppet/type.rb:1908:in `initialize'
./spec/../lib/puppet/type/file.rb:400:in `initialize'
./spec/unit/resource/catalog.rb:713:in `new'
./spec/unit/resource/catalog.rb:713:
./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:22:in `run'
./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `each'
./spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb:17:in `run'
</pre>

The common factor in each case being the "Invalid parameter" messages and the 
first five lines of the stack trace.  

That this is order dependent has been confirmed by making the problem appear on 
a fresh, unmodified copy of 0.25.0rc1 by simply touching spec files to force 
test execution error and then making the problem go away by touching one of the 
spec files again to force a different ordering.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to