Open
Description
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.