It certainly isn't a bug in the filetype, but the ParsedFile code is complex enough in this area that it can be (always is?) hard to follow the code paths, so it wouldn't surprise me if there's a place where we're unexpectedly caching results.
Note, at the least, that some places use the @target_objects class instance variable to get a list of targets. It's true, though, that the before block should be stopping this kind of leak. On Dec 21, 2009, at 2:42 PM, Jesse A Wolfe wrote: > Empirically, that's not what's happening now. Is that a bug in > filetype(:ram) ? > > On Mon, Dec 21, 2009 at 1:52 PM, Markus Roberts <[email protected] > > wrote: > > I found this doing idempotency tests (#2879), but there are > apparently > > other ways for external state to leak into this test, as reported by > > James. > > > > --- a/spec/unit/provider/mount/parsed.rb > > +++ b/spec/unit/provider/mount/parsed.rb > > @@ -140,10 +140,12 @@ describe provider_class do > > end > > > > it "should write the mount to disk when :flush is called" do > > + old_text = > @provider_class.target_object(@provider_class.default_target).read > > + > > I don't understand how this could leak state in or out. In the > before block: > > > @provider_class > .stubs > (:target_object > ).returns(Puppet::Util::FileType.filetype(:ram).new("eh")) > > so shouldn't it be getting a new, clean whats-it every time? > > > ----------------------------------------------------------- > Life is not so bad if you have plenty of luck, a > good physique and not too much imagination. > —Christopher Isherwood > ------------------------------------------------------------ > > -- > > You received this message because you are subscribed to the Google > Groups "Puppet Developers" 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-dev?hl=en > . > > > > > -- > > You received this message because you are subscribed to the Google > Groups "Puppet Developers" 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-dev?hl=en > . -- Beware of all enterprises that require new clothes. -- Henry David Thoreau --------------------------------------------------------------------- Luke Kanies -|- http://reductivelabs.com -|- +1(615)594-8199 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" 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-dev?hl=en.
