Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Regression on ruby 1.8.7 in rspec-core 3.2.0 #1864

Closed
cmurphy opened this issue Feb 4, 2015 · 4 comments
Closed

Regression on ruby 1.8.7 in rspec-core 3.2.0 #1864

cmurphy opened this issue Feb 4, 2015 · 4 comments

Comments

@cmurphy
Copy link

cmurphy commented Feb 4, 2015

We're seeing an issue on ruby 1.8.7 when trying to require rspec. The traceback is

/home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:512:in `all_hooks_for': return from proc-closure (LocalJumpError)
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:564:in `process'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/flat_map.rb:11:in `map'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/flat_map.rb:11:in `flat_map'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:563:in `process'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/hooks.rb:429:in `register_globals'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/example_group.rb:394:in `set_it_up'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/example_group.rb:361:in `subclass'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/example_group.rb:253:in `describe'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/dsl.rb:43:in `__send__'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/dsl.rb:43:in `describe'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/dsl.rb:82:in `__send__'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/dsl.rb:82:in `describe'
    from /home/travis/build/puppetlabs/puppetlabs-apt/spec/classes/apt_spec.rb:2
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1226:in `load'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1226:in `load_spec_files'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:in `each'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:97:in `setup'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:85:in `run'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:70:in `run'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/lib/rspec/core/runner.rb:38:in `invoke'
    from /home/travis/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-3.2.0/exe/rspec:4

You can see the whole test environment here: https://travis-ci.org/puppetlabs/puppetlabs-apt/jobs/49343840

Since https://rubygems.org/gems/rspec-core still claims support for ruby 1.8.7 this seems like a regression to us.

Happy to provide any other info I can.

@myronmarston
Copy link
Member

Thanks for reporting this. RSpec 3 does still support 1.8.7, and in fact our travis builds are all green on 1.8.7. There must be a case that your environment, configuration or specs hit that our test cases don't. I'll have to dig into it to see what's causing that.

To repro, do I just clone https://github.com/puppetlabs/puppetlabs-apt, bundle install and bundle exec rspec on 1.8.7? Or is there more to it than that?

@cmurphy
Copy link
Author

cmurphy commented Feb 5, 2015

We've pinned rspec-core to 3.1.7, so you'll have to check out e8bef852edb3451d07fb3ff7f865aa7329a25c42 to see the issue.

Thanks!

@myronmarston
Copy link
Member

So it appears that the problem is Puppet's Symbol#to_proc monkey patch:

https://github.com/puppetlabs/puppet/blob/3.7.4/lib/puppet/util/monkey_patches.rb#L80-L83

...which explains why I never saw this failure on 1.8.7 before. I've put together a gist demonstrating that the presence of that monkey patch causes this failure:

https://gist.github.com/myronmarston/75d5b470a8d258ed7f04

Clone that, and on 1.8.7, run bundle exec example_spec.rb and compare that to MONKEYPATCH_SYMBOL=1 bundle exec rspec example_spec.rb -- you'll see that the LocalJumpError only happens when your Symbol#to_proc monkey patch is loaded.

It's not clear to me why your monkey patch causes this error, but regardless, when you monkey patch a core ruby method like Symbol#to_proc, and it breaks things, you are on your own. We can't support you.

I noticed that that monkey patch was removed in puppetlabs/puppet@65ca17c, so maybe you can upgrade to a newer puppet to avoid the error?

@cmurphy
Copy link
Author

cmurphy commented Feb 5, 2015

Thanks so much for looking into this. We're planning to drop support for that version of puppet soon, so we'll just pin until then. Thanks!

tfhartmann added a commit to tfhartmann/puppet-splunk that referenced this issue Feb 9, 2015
Looks like we are running into the same issue that the
puppetlabs/puppetlabs-apt folks did
rspec/rspec-core#1864
tfhartmann added a commit to tfhartmann/puppet-splunk that referenced this issue Feb 9, 2015
This should address the issue that @robruma is seeing in
huit#52

This looks like we hit a similar issue to the puppetlabs/puppetlabs-apt
module

rspec/rspec-core#1864
mcanevet added a commit to camptocamp/modulesync_configs that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-archive that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-accounts that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-administration that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-apache_c2c that referenced this issue Feb 25, 2015
mcanevet added a commit to voxpupuli/puppet-augeas that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-aws that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-backup that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-bind that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-buildenv that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-collectd that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-couchdb that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-dell that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-deploy that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-dhcp that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-dovecot that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-firewall_c2c that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-fprint that referenced this issue Feb 25, 2015
mcanevet added a commit to camptocamp/puppet-freepbx that referenced this issue Feb 25, 2015
jhoblitt added a commit to jhoblitt/aco-yum_autoupdate that referenced this issue May 17, 2015
jhoblitt added a commit to jhoblitt/aco-yum_autoupdate that referenced this issue May 17, 2015
jhoblitt added a commit to jhoblitt/aco-yum_autoupdate that referenced this issue May 17, 2015
jhoblitt added a commit to jhoblitt/puppet-mcelog that referenced this issue Jun 6, 2015
jhoblitt added a commit to jhoblitt/puppet-mcelog that referenced this issue Jun 6, 2015
jhoblitt added a commit to jhoblitt/puppet-mcelog that referenced this issue Jun 6, 2015
jhoblitt added a commit to jhoblitt/puppet-ipmi that referenced this issue Jun 6, 2015
jhoblitt added a commit to jhoblitt/puppet-udev that referenced this issue Jun 6, 2015
jhoblitt added a commit to jhoblitt/puppet-nsstools that referenced this issue Jun 7, 2015
jhoblitt added a commit to jhoblitt/puppet-awstats that referenced this issue Jul 3, 2015
jhoblitt added a commit to jhoblitt/puppet-rpmkey that referenced this issue Jul 25, 2015
jhoblitt added a commit to jhoblitt/puppet-rpmkey that referenced this issue Jul 25, 2015
tuxmea pushed a commit to example42/puppet-iptables that referenced this issue Jul 26, 2015
tuxmea pushed a commit to example42/puppet-activemq that referenced this issue Jul 30, 2015
JCotton1123 added a commit to JCotton1123/puppet-duplicity that referenced this issue Aug 8, 2015
benjunmun pushed a commit to benjunmun/puppet_deployment that referenced this issue Oct 5, 2015
benjunmun pushed a commit to benjunmun/puppet_deployment that referenced this issue Oct 5, 2015
This fixes Travis builds on ruby 1.8.7.
jhoblitt added a commit to jhoblitt/puppet-zeromq that referenced this issue Oct 14, 2015
stschulte referenced this issue in propyless/puppet-rpmkey Oct 18, 2015
gerhardsam added a commit to gerhardsam/puppet-check_mk that referenced this issue Feb 25, 2016
This is done to cope with regression on ruby with rspec-core 3.2.0:

rspec/rspec-core#1864
gerhardsam added a commit to gerhardsam/puppet-check_mk that referenced this issue Feb 26, 2016
This is done to cope with regression on ruby with rspec-core 3.2.0:

rspec/rspec-core#1864
robinbowes added a commit to yo61/puppet-module-skeleton that referenced this issue Aug 10, 2016
* upstream/master:
  Pin rspec to < 3.2.0 Caused by Puppet monkey patches (rspec/rspec-core#1864)
  add contributors rake task example
  add contributors rake task
  Update and rename centos-65-x64.yml to centos-66-x64.yml
cegeka-jenkins pushed a commit to cegeka/puppet-extlib that referenced this issue Oct 23, 2017
cegeka-jenkins pushed a commit to cegeka/puppet-foreman that referenced this issue Oct 23, 2017
cegeka-jenkins pushed a commit to cegeka/puppet-udev that referenced this issue Oct 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants