Issue #12490 has been updated by Daniel Pittman.

Chris Price wrote:
> The execute_posix method:
> 
> a) Should not be called during windows test runs, and

Ideally we want to test as much of the behaviour on Windows as we can, just as 
we want to test as much Windows behaviour on our Unix systems as we can.  The 
less places a test runs the less likely we are to catch a problem early.

> b) Needs to take more care not to inadvertently set environment variables in 
> the main ruby process.

Yeah.  That test is a bad test, since assuming that nothing bad can possibly 
happen inside the forked child when it gets run in the parent is ... terrible.

This would expose the issue of, for example, the work-around for fork vs 
ActiveRecord that will start closing file descriptors too.  Having to know that 
much is a real problem.

We should probably better not unit test this at all, or abstract the platform 
details to an easy to stub interface if we must, than to assume we can make 
`fork` and `yield` equivalent safely.

----------------------------------------
Bug #12490: execution_spec is stomping on process ENV variables
https://projects.puppetlabs.com/issues/12490

Author: Chris Price
Status: Accepted
Priority: Urgent
Assignee: Chris Price
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


The execute_posix method:

a) Should not be called during windows test runs, and

b) Needs to take more care not to inadvertently set environment variables in 
the main ruby process.

When the test was written, I assumed that the latter would not be a problem 
because the environment variable manipulation was only supposed to happen in a 
forked process; however, because these tests stub the Kernel.fork method, the 
process is never actually forked and thus the environment variable manipulation 
happens in the parent process. 


-- 
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://projects.puppetlabs.com/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