-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix tests for resque v1.26.0 #11
Fix tests for resque v1.26.0 #11
Conversation
For what it's worth, now that I have working tests I'm going to fix it for |
@nevans do all tests pass for you? I get one failure in |
Wow awesome @nevans. Thank you for tackling this! |
@stulentsev yes, they all pass for me, using |
@stulentsev I didn't see the issues in this branch, but I can get irregular failures for older rubies in the branches for #13 and #14. I think it must be due to race conditions, since the tests rely on One way to lazily avoid the race conditions would be to simply increase the sleep times. I'll try that first. |
It does seem like there might be a bug in earlier ruby versions, where the TSTP signal is being missed or the child isn't shutting down after TermException + TSTP. That results in a SIGKILL (after |
I'm still doing some more testing and trying to find some documentation for why this would be the case, but it currently seems to me that this can be fixed by simply changing the child shutdown signal from |
* Tests use normal fork and communicate with test runner via IO.pipe. * Tests uses a zero interval to exit ASAP without timeout when done. * Children need to `exit!` to avoid running test/unit at_exit hooks. * Gemspec depends on a specific minor version of resque. We must depend on ~> v1.26.0, because these methods are considered internal, are not a stable API, and can change with every version. I.e. as written, the tests do not pass with v1.25.0 nor with v1.27.0. Until Resque::Worker has a stable API we can target, this gem will need to be tested with each minor release.
There's a lot of unhelpful noise that comes from running `ruby -w`: https://mislav.net/2011/06/ruby-verbose-mode/
In tests, `SIGTSTP` is often ignored for ruby 2.3-2.5 (usually works in 2.6?). I assume this has something to do with some signals temporarily being blocked by ruby, but I'm really not sure. However, in my tests, `SIGQUIT` always gets through to the handler. Since `SIGQUIT` is normally registered to call `shutdown` anyway, I've simply re-registered it to continue that role in the `term_child` environment.
c455d7d
to
372ea1d
Compare
This has been tested with all currently supported versions of ruby (2.3, 2.4, 2.5, and 2.6).
Major changes (as documented in 9815ab6):
exit!
to avoid running test/unit at_exit hooks.We must depend on ~> v1.26.0, because these methods are considered
internal, are not a stable API, and can change with every version. I.e.
as written, the tests do not pass with v1.25.0 nor with v1.27.0. Until
Resque::Worker has a stable API we can target, this gem will need to be
tested with each minor release.