Skip to content

Commit

Permalink
Merge pull request grpc#3171 from tbetbetbe/grpc_ruby_improve_test_st…
Browse files Browse the repository at this point in the history
…ability

Improves test stability
  • Loading branch information
stanley-cheung committed Aug 31, 2015
2 parents cbdfaba 391664a commit c88e834
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/ruby/.rspec
Original file line number Diff line number Diff line change
@@ -1,5 1,6 @@
-I.
-Ipb
--backtrace
--require spec_helper
--format documentation
--color
12 changes: 6 additions & 6 deletions src/ruby/lib/grpc/generic/rpc_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 417,18 @@ def loop_handle_server_calls
begin
an_rpc = @server.request_call(@cq, loop_tag, INFINITE_FUTURE)
c = new_active_server_call(an_rpc)
unless c.nil?
mth = an_rpc.method.to_sym
@pool.schedule(c) do |call|
rpc_descs[mth].run_server_method(call, rpc_handlers[mth])
end
end
rescue Core::CallError, RuntimeError => e
# these might happen for various reasonse. The correct behaviour of
# the server is to log them and continue, if it's not shutting down.
GRPC.logger.warn("server call failed: #{e}") unless stopped?
next
end
unless c.nil?
mth = an_rpc.method.to_sym
@pool.schedule(c) do |call|
rpc_descs[mth].run_server_method(call, rpc_handlers[mth])
end
end
end
@running = false
GRPC.logger.info("stopped: #{self}")
Expand Down
3 changes: 1 addition & 2 deletions src/ruby/spec/client_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

require 'grpc'
require 'spec_helper'

include GRPC::Core

Expand All @@ -41,7 40,7 @@
end

def deadline
Time.now 2
Time.now 5
end

def server_allows_client_to_proceed
Expand Down
1 change: 0 additions & 1 deletion src/ruby/spec/pb/health/checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 179,6 @@ def can_run_codegen_check

describe 'running on RpcServer' do
RpcServer = GRPC::RpcServer
StatusCodes = GRPC::Core::StatusCodes
CheckerStub = Grpc::Health::Checker.rpc_stub_class

before(:each) do
Expand Down

0 comments on commit c88e834

Please sign in to comment.