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

JRuby failing SIGINT catching spec in rspec-core #3413

Closed
myrridin opened this issue Oct 22, 2015 · 3 comments
Closed

JRuby failing SIGINT catching spec in rspec-core #3413

myrridin opened this issue Oct 22, 2015 · 3 comments

Comments

@myrridin
Copy link

I recently opened a PR to rspec-core to add a new spec, specifically testing that it's properly trapping SIGINT. The PR is here: rspec/rspec-core#2096

It passes all builds except MRI 1.9.2 (weird) and all JRuby versions. @headius asked me to file this as a bug, though unfortunately I'm unable to reproduce in pure JRuby with the spec below, which passes fine in jruby 1.7.19 (1.9.3p551) and jruby 9.0.0.0 (2.2.2)

https://gist.github.com/myrridin/43d898e009f4bd90f390

Are there differences in signal trapping between MRI and JRuby? Any ideas what might be causing the failures?

@headius
Copy link
Member

headius commented Oct 22, 2015

The main difference in signal handling is that by default, the JVM itself traps INT, so you need to explicitly trap it in Ruby code. MRI automatically traps INT and raises Interrupt from startup.

There are also a few other signals the JVM traps that are not related to this issue.

The only thing I can think is that somehow the trap is never getting set.

@myrridin
Copy link
Author

It seems as though my approach on the rspec test was causing a timing issue. I'd send an asynchronous signal, then hope the thing I wanted to happen did before the test ended. I believe the different performance characteristics explains this discrepancy.

I switched my test methodology, and all looks good. That PR was merged. From what I can tell, this issue can be simply closed.

@mkristian
Copy link
Member

@myrridin please feel free to reopen it again if you think it is JRuby issue

@enebo enebo added this to the Invalid or Duplicate milestone Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants