Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something in RubySpec triggers ENV to clear #2440

Open
headius opened this issue Jan 8, 2015 · 0 comments
Open

Something in RubySpec triggers ENV to clear #2440

headius opened this issue Jan 8, 2015 · 0 comments

Comments

@headius
Copy link
Member

headius commented Jan 8, 2015

I thought this was just a TravisCI glitch, but then it happened to me.

It appears that something in RubySpec is causing ENV to get cleared, or at least ENV['HOME']. It is intermittent. The resulting failures look like this:

An exception occurred during: before :each
File.expand_path does not modify a HOME string argument ERROR
NoMethodError: undefined method `chomp' for nil:NilClass
/Users/headius/projects/jruby/spec/ruby/core/file/expand_path_spec.rb:92:in `(root)'
org/jruby/RubyBasicObject.java:1641:in `instance_eval'
org/jruby/RubyEnumerable.java:1422:in `all?'
org/jruby/RubyFixnum.java:300:in `times'
org/jruby/RubyArray.java:1567:in `each'
/Users/headius/projects/jruby/spec/ruby/core/file/expand_path_spec.rb:5:in `(root)'
org/jruby/RubyKernel.java:969:in `load'
org/jruby/RubyBasicObject.java:1641:in `instance_eval'
org/jruby/RubyArray.java:1567:in `each'

The chomp call here fails because ENV['HOME'] comes back nil. This always affects the same FILE specs and from what I've seen it's largely the same set of errors. It happens only once in a blue moon.

I have no explanation. Specs for env that might modify values appear to all have ensure logic to restore them.

I got this on master locally on OS X Yosemite, and was not able to reproduce it after the one time it failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants