-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Improve FFI::Function can wrap a blocking function spec #2299
Comments
nirvdrum
added a commit
that referenced
this issue
Dec 10, 2014
…d to. See #2299: 'Improve FFI::Function can wrap a blocking function spec' for details.
how's this look? it 'can wrap a blocking function' do
fp = FFI::Function.new(:void, [ :int ], @libtest.find_function('testBlocking'), :blocking => true)
threads = 10.times.map do |x|
Thread.new do
time = Time.now
fp.call(2)
expect(Time.now - time).to be > 2
end
end
threads.each { |t| t.join }
end |
This was referenced Dec 10, 2014
It looks fine to me. But what's the significance of running it 10 times? |
@nirvdrum MOAR TESTING! |
just trying to make sure it gets caught even if under heavy-ish load... still not the greatest but... |
@tduehr Can this be closed? |
I really don't know... This version should be better but I don't know if it's actually correct or there isn't a better one... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The spec for FFI::Function wrapping a blocking function has proven to be problematic on Travis, where tests can take longer than the 1 second threshold. One "fix" is to increase the threshold. In speaking with @tduehr, this whole spec seems bad though and thus should be revisited.
For posterity, here is the failure from https://travis-ci.org/jruby/jruby/jobs/43403371:
The text was updated successfully, but these errors were encountered: