You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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.
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.
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)
andjruby 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?
The text was updated successfully, but these errors were encountered: