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

Signal + thread tests from MRI are unreliable #4956

headius opened this Issue Jan 8, 2018 · 0 comments


None yet
1 participant

headius commented Jan 8, 2018

There are two tests in MRI that test whether a Thread can be joined from a Signal trap handler. Both tend to fail intermittently on JRuby (the INT trap fails to capture the event), likely because of some race between setting up the signal handler and initiating the interrupt.

Because these are very peculiar cases, and test behavior specific to MRI's VM (thread state and signal handlers did not mix) I'm excluding these cases from our run.

@headius headius added core tests labels Jan 8, 2018

@headius headius added this to the Non-Release milestone Jan 8, 2018

headius added a commit that referenced this issue Jan 8, 2018

Exclude these pesky thread+signal specs.
I am not convinced the intermittent failures here indicate an
issue in JRuby. Rather, I suspect there's a race, since these
tests involve setting up a signal handler, signalling INT from a
thread, and joining in both main and the handler itself. However
I have been unable to come up a reason for the race, so I have
filed #4956 to track this exclusion.

An example script, which should run forever but dies:

loop {
  Signal.trap(:INT, "DEFAULT")
  t0 = Thread.current
  t = {Thread.pass until t0.stop?; Process.kill(:INT, $$)}

  Signal.trap :INT do

  print '.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment