grpc 1.8.7-x86-mingw32 → 1.9.0.pre1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8990b6fe3290b0e01532d330315b1731cfe683ba77405c778db7451ba129702
4
- data.tar.gz: 7756c893d584478650647c079f63dac1cec3c937d4f9ebc28b726f60962d743d
3
+ metadata.gz: ec3b0f101711df9c6d7815b85820b6dcb076031e5eff2248d637ea041c0c0963
4
+ data.tar.gz: cbf18587cd6a77157cf9ece303c32177c31ce17b20d324255dcc71a235efa1c8
5
5
  SHA512:
6
- metadata.gz: 5eec4cd7c9c7135bd6469100f1446671a45ad72a503914099d95f3d696c843c61caa1ad9f3635cda4f5a6be00bd639d02b4392283d00aeafd7146bc4ce5d3bce
7
- data.tar.gz: fb79f48ef781326355b34ecd979124070bdec49f109b482320c10505c7787e2a8f06e49af7b68737fe74e3a10d2198c340875727f3f742ab6c0ca20279ad3edf
6
+ metadata.gz: ffa3513065f470dec14cbe0bf5710738be2a07a8ab6fbfec3228ab01c15cb5e4a0fb95545f09cde61f638f9ed6a37371e1c8774c14d8f73edd7232e60a0d3cb8
7
+ data.tar.gz: 592b10a24992a6e2d4f27de861cbf53dfbbadd78f165a1c214f104512506eb6e7b64f9e3974b564f42e6c7d437ea00a711b0b496c2bec729f5b1d028e6fddead
Binary file
Binary file
@@ -223,21 +223,6 @@ gpr_cmdline_destroy_type gpr_cmdline_destroy_import;
223
223
  gpr_cmdline_usage_string_type gpr_cmdline_usage_string_import;
224
224
  gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
225
225
  gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
226
- gpr_histogram_create_type gpr_histogram_create_import;
227
- gpr_histogram_destroy_type gpr_histogram_destroy_import;
228
- gpr_histogram_add_type gpr_histogram_add_import;
229
- gpr_histogram_merge_type gpr_histogram_merge_import;
230
- gpr_histogram_percentile_type gpr_histogram_percentile_import;
231
- gpr_histogram_mean_type gpr_histogram_mean_import;
232
- gpr_histogram_stddev_type gpr_histogram_stddev_import;
233
- gpr_histogram_variance_type gpr_histogram_variance_import;
234
- gpr_histogram_maximum_type gpr_histogram_maximum_import;
235
- gpr_histogram_minimum_type gpr_histogram_minimum_import;
236
- gpr_histogram_count_type gpr_histogram_count_import;
237
- gpr_histogram_sum_type gpr_histogram_sum_import;
238
- gpr_histogram_sum_of_squares_type gpr_histogram_sum_of_squares_import;
239
- gpr_histogram_get_contents_type gpr_histogram_get_contents_import;
240
- gpr_histogram_merge_contents_type gpr_histogram_merge_contents_import;
241
226
  gpr_join_host_port_type gpr_join_host_port_import;
242
227
  gpr_split_host_port_type gpr_split_host_port_import;
243
228
  gpr_log_severity_string_type gpr_log_severity_string_import;
@@ -510,21 +495,6 @@ void grpc_rb_load_imports(HMODULE library) {
510
495
  gpr_cmdline_usage_string_import = (gpr_cmdline_usage_string_type) GetProcAddress(library, "gpr_cmdline_usage_string");
511
496
  gpr_cpu_num_cores_import = (gpr_cpu_num_cores_type) GetProcAddress(library, "gpr_cpu_num_cores");
512
497
  gpr_cpu_current_cpu_import = (gpr_cpu_current_cpu_type) GetProcAddress(library, "gpr_cpu_current_cpu");
513
- gpr_histogram_create_import = (gpr_histogram_create_type) GetProcAddress(library, "gpr_histogram_create");
514
- gpr_histogram_destroy_import = (gpr_histogram_destroy_type) GetProcAddress(library, "gpr_histogram_destroy");
515
- gpr_histogram_add_import = (gpr_histogram_add_type) GetProcAddress(library, "gpr_histogram_add");
516
- gpr_histogram_merge_import = (gpr_histogram_merge_type) GetProcAddress(library, "gpr_histogram_merge");
517
- gpr_histogram_percentile_import = (gpr_histogram_percentile_type) GetProcAddress(library, "gpr_histogram_percentile");
518
- gpr_histogram_mean_import = (gpr_histogram_mean_type) GetProcAddress(library, "gpr_histogram_mean");
519
- gpr_histogram_stddev_import = (gpr_histogram_stddev_type) GetProcAddress(library, "gpr_histogram_stddev");
520
- gpr_histogram_variance_import = (gpr_histogram_variance_type) GetProcAddress(library, "gpr_histogram_variance");
521
- gpr_histogram_maximum_import = (gpr_histogram_maximum_type) GetProcAddress(library, "gpr_histogram_maximum");
522
- gpr_histogram_minimum_import = (gpr_histogram_minimum_type) GetProcAddress(library, "gpr_histogram_minimum");
523
- gpr_histogram_count_import = (gpr_histogram_count_type) GetProcAddress(library, "gpr_histogram_count");
524
- gpr_histogram_sum_import = (gpr_histogram_sum_type) GetProcAddress(library, "gpr_histogram_sum");
525
- gpr_histogram_sum_of_squares_import = (gpr_histogram_sum_of_squares_type) GetProcAddress(library, "gpr_histogram_sum_of_squares");
526
- gpr_histogram_get_contents_import = (gpr_histogram_get_contents_type) GetProcAddress(library, "gpr_histogram_get_contents");
527
- gpr_histogram_merge_contents_import = (gpr_histogram_merge_contents_type) GetProcAddress(library, "gpr_histogram_merge_contents");
528
498
  gpr_join_host_port_import = (gpr_join_host_port_type) GetProcAddress(library, "gpr_join_host_port");
529
499
  gpr_split_host_port_import = (gpr_split_host_port_type) GetProcAddress(library, "gpr_split_host_port");
530
500
  gpr_log_severity_string_import = (gpr_log_severity_string_type) GetProcAddress(library, "gpr_log_severity_string");
@@ -36,7 +36,6 @@
36
36
  #include <grpc/support/avl.h>
37
37
  #include <grpc/support/cmdline.h>
38
38
  #include <grpc/support/cpu.h>
39
- #include <grpc/support/histogram.h>
40
39
  #include <grpc/support/host_port.h>
41
40
  #include <grpc/support/log.h>
42
41
  #include <grpc/support/log_windows.h>
@@ -559,7 +558,7 @@ extern grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import;
559
558
  typedef void(*grpc_slice_buffer_move_first_no_ref_type)(grpc_slice_buffer* src, size_t n, grpc_slice_buffer* dst);
560
559
  extern grpc_slice_buffer_move_first_no_ref_type grpc_slice_buffer_move_first_no_ref_import;
561
560
  #define grpc_slice_buffer_move_first_no_ref grpc_slice_buffer_move_first_no_ref_import
562
- typedef void(*grpc_slice_buffer_move_first_into_buffer_type)(grpc_exec_ctx* exec_ctx, grpc_slice_buffer* src, size_t n, void* dst);
561
+ typedef void(*grpc_slice_buffer_move_first_into_buffer_type)(grpc_slice_buffer* src, size_t n, void* dst);
563
562
  extern grpc_slice_buffer_move_first_into_buffer_type grpc_slice_buffer_move_first_into_buffer_import;
564
563
  #define grpc_slice_buffer_move_first_into_buffer grpc_slice_buffer_move_first_into_buffer_import
565
564
  typedef grpc_slice(*grpc_slice_buffer_take_first_type)(grpc_slice_buffer* src);
@@ -649,51 +648,6 @@ extern gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
649
648
  typedef unsigned(*gpr_cpu_current_cpu_type)(void);
650
649
  extern gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
651
650
  #define gpr_cpu_current_cpu gpr_cpu_current_cpu_import
652
- typedef gpr_histogram*(*gpr_histogram_create_type)(double resolution, double max_bucket_start);
653
- extern gpr_histogram_create_type gpr_histogram_create_import;
654
- #define gpr_histogram_create gpr_histogram_create_import
655
- typedef void(*gpr_histogram_destroy_type)(gpr_histogram* h);
656
- extern gpr_histogram_destroy_type gpr_histogram_destroy_import;
657
- #define gpr_histogram_destroy gpr_histogram_destroy_import
658
- typedef void(*gpr_histogram_add_type)(gpr_histogram* h, double x);
659
- extern gpr_histogram_add_type gpr_histogram_add_import;
660
- #define gpr_histogram_add gpr_histogram_add_import
661
- typedef int(*gpr_histogram_merge_type)(gpr_histogram* dst, const gpr_histogram* src);
662
- extern gpr_histogram_merge_type gpr_histogram_merge_import;
663
- #define gpr_histogram_merge gpr_histogram_merge_import
664
- typedef double(*gpr_histogram_percentile_type)(gpr_histogram* histogram, double percentile);
665
- extern gpr_histogram_percentile_type gpr_histogram_percentile_import;
666
- #define gpr_histogram_percentile gpr_histogram_percentile_import
667
- typedef double(*gpr_histogram_mean_type)(gpr_histogram* histogram);
668
- extern gpr_histogram_mean_type gpr_histogram_mean_import;
669
- #define gpr_histogram_mean gpr_histogram_mean_import
670
- typedef double(*gpr_histogram_stddev_type)(gpr_histogram* histogram);
671
- extern gpr_histogram_stddev_type gpr_histogram_stddev_import;
672
- #define gpr_histogram_stddev gpr_histogram_stddev_import
673
- typedef double(*gpr_histogram_variance_type)(gpr_histogram* histogram);
674
- extern gpr_histogram_variance_type gpr_histogram_variance_import;
675
- #define gpr_histogram_variance gpr_histogram_variance_import
676
- typedef double(*gpr_histogram_maximum_type)(gpr_histogram* histogram);
677
- extern gpr_histogram_maximum_type gpr_histogram_maximum_import;
678
- #define gpr_histogram_maximum gpr_histogram_maximum_import
679
- typedef double(*gpr_histogram_minimum_type)(gpr_histogram* histogram);
680
- extern gpr_histogram_minimum_type gpr_histogram_minimum_import;
681
- #define gpr_histogram_minimum gpr_histogram_minimum_import
682
- typedef double(*gpr_histogram_count_type)(gpr_histogram* histogram);
683
- extern gpr_histogram_count_type gpr_histogram_count_import;
684
- #define gpr_histogram_count gpr_histogram_count_import
685
- typedef double(*gpr_histogram_sum_type)(gpr_histogram* histogram);
686
- extern gpr_histogram_sum_type gpr_histogram_sum_import;
687
- #define gpr_histogram_sum gpr_histogram_sum_import
688
- typedef double(*gpr_histogram_sum_of_squares_type)(gpr_histogram* histogram);
689
- extern gpr_histogram_sum_of_squares_type gpr_histogram_sum_of_squares_import;
690
- #define gpr_histogram_sum_of_squares gpr_histogram_sum_of_squares_import
691
- typedef const uint32_t*(*gpr_histogram_get_contents_type)(gpr_histogram* histogram, size_t* count);
692
- extern gpr_histogram_get_contents_type gpr_histogram_get_contents_import;
693
- #define gpr_histogram_get_contents gpr_histogram_get_contents_import
694
- typedef void(*gpr_histogram_merge_contents_type)(gpr_histogram* histogram, const uint32_t* data, size_t data_count, double min_seen, double max_seen, double sum, double sum_of_squares, double count);
695
- extern gpr_histogram_merge_contents_type gpr_histogram_merge_contents_import;
696
- #define gpr_histogram_merge_contents gpr_histogram_merge_contents_import
697
651
  typedef int(*gpr_join_host_port_type)(char** out, const char* host, int port);
698
652
  extern gpr_join_host_port_type gpr_join_host_port_import;
699
653
  #define gpr_join_host_port gpr_join_host_port_import
@@ -814,7 +768,7 @@ extern gpr_stats_inc_type gpr_stats_inc_import;
814
768
  typedef intptr_t(*gpr_stats_read_type)(const gpr_stats_counter* c);
815
769
  extern gpr_stats_read_type gpr_stats_read_import;
816
770
  #define gpr_stats_read gpr_stats_read_import
817
- typedef int(*gpr_thd_new_type)(gpr_thd_id* t, void (*thd_body)(void* arg), void* arg, const gpr_thd_options* options);
771
+ typedef int(*gpr_thd_new_type)(gpr_thd_id* t, const char* thd_name, void (*thd_body)(void* arg), void* arg, const gpr_thd_options* options);
818
772
  extern gpr_thd_new_type gpr_thd_new_import;
819
773
  #define gpr_thd_new gpr_thd_new_import
820
774
  typedef gpr_thd_options(*gpr_thd_options_default_type)(void);
Binary file
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.8.7'
17
+ VERSION = '1.9.0.pre1'
18
18
  end
@@ -16,9 +16,10 @@ require 'timeout'
16
16
 
17
17
  include Timeout
18
18
  include GRPC::Core
19
+ include GRPC::Spec::Helpers
19
20
 
20
21
  def start_server(port = 0)
21
- @srv = GRPC::RpcServer.new(pool_size: 1)
22
+ @srv = new_rpc_server_for_testing(pool_size: 1)
22
23
  server_port = @srv.add_http2_port("localhost:#{port}", :this_port_is_insecure)
23
24
  @srv.handle(EchoService)
24
25
  @server_thd = Thread.new { @srv.run }
@@ -95,7 +95,7 @@ describe 'client-server auth' do
95
95
  server_opts = {
96
96
  poll_period: 1
97
97
  }
98
- @srv = RpcServer.new(**server_opts)
98
+ @srv = new_rpc_server_for_testing(**server_opts)
99
99
  port = @srv.add_http2_port('0.0.0.0:0', create_server_creds)
100
100
  @srv.handle(SslTestService)
101
101
  @srv_thd = Thread.new { @srv.run }
@@ -542,7 +542,7 @@ end
542
542
  describe 'the http client/server' do
543
543
  before(:example) do
544
544
  server_host = '0.0.0.0:0'
545
- @server = GRPC::Core::Server.new(nil)
545
+ @server = new_core_server_for_testing(nil)
546
546
  server_port = @server.add_http2_port(server_host, :this_port_is_insecure)
547
547
  @server.start
548
548
  @ch = Channel.new("0.0.0.0:#{server_port}", nil, :this_channel_is_insecure)
@@ -574,7 +574,7 @@ describe 'the secure http client/server' do
574
574
  server_host = '0.0.0.0:0'
575
575
  server_creds = GRPC::Core::ServerCredentials.new(
576
576
  nil, [{ private_key: certs[1], cert_chain: certs[2] }], false)
577
- @server = GRPC::Core::Server.new(nil)
577
+ @server = new_core_server_for_testing(nil)
578
578
  server_port = @server.add_http2_port(server_host, server_creds)
579
579
  @server.start
580
580
  args = { Channel::SSL_TARGET => 'foo.test.google.fr' }
@@ -40,7 +40,7 @@ describe GRPC::ActiveCall do
40
40
  before(:each) do
41
41
  @pass_through = proc { |x| x }
42
42
  host = '0.0.0.0:0'
43
- @server = GRPC::Core::Server.new(nil)
43
+ @server = new_core_server_for_testing(nil)
44
44
  server_port = @server.add_http2_port(host, :this_port_is_insecure)
45
45
  @server.start
46
46
  @ch = GRPC::Core::Channel.new("0.0.0.0:#{server_port}", nil,
@@ -228,7 +228,7 @@ describe 'ClientStub' do
228
228
  th.join
229
229
  end
230
230
 
231
- it 'should receive UNAUTHENTICATED if call credentials plugin fails' do
231
+ it 'should receive UNAVAILABLE if call credentials plugin fails' do
232
232
  server_port = create_secure_test_server
233
233
  th = run_request_response(@sent_msg, @resp, @pass)
234
234
 
@@ -252,7 +252,7 @@ describe 'ClientStub' do
252
252
  unauth_error_occured = false
253
253
  begin
254
254
  get_response(stub, credentials: creds)
255
- rescue GRPC::Unauthenticated => e
255
+ rescue GRPC::Unavailable => e
256
256
  unauth_error_occured = true
257
257
  expect(e.details.include?(error_message)).to be true
258
258
  end
@@ -888,12 +888,12 @@ describe 'ClientStub' do
888
888
  secure_credentials = GRPC::Core::ServerCredentials.new(
889
889
  nil, [{ private_key: certs[1], cert_chain: certs[2] }], false)
890
890
 
891
- @server = GRPC::Core::Server.new(nil)
891
+ @server = new_core_server_for_testing(nil)
892
892
  @server.add_http2_port('0.0.0.0:0', secure_credentials)
893
893
  end
894
894
 
895
895
  def create_test_server
896
- @server = GRPC::Core::Server.new(nil)
896
+ @server = new_core_server_for_testing(nil)
897
897
  @server.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
898
898
  end
899
899
 
@@ -14,7 +14,7 @@
14
14
  require 'spec_helper'
15
15
 
16
16
  describe GRPC::InterceptorRegistry do
17
- let(:server) { RpcServer.new }
17
+ let(:server) { new_rpc_server_for_testing }
18
18
  let(:interceptor) { TestServerInterceptor.new }
19
19
  let(:interceptors) { [interceptor] }
20
20
  let(:registry) { described_class.new(interceptors) }
@@ -172,7 +172,7 @@ describe GRPC::RpcServer do
172
172
  it 'can be created with just some args' do
173
173
  opts = { server_args: { a_channel_arg: 'an_arg' } }
174
174
  blk = proc do
175
- RpcServer.new(**opts)
175
+ new_rpc_server_for_testing(**opts)
176
176
  end
177
177
  expect(&blk).not_to raise_error
178
178
  end
@@ -183,7 +183,7 @@ describe GRPC::RpcServer do
183
183
  server_args: { a_channel_arg: 'an_arg' },
184
184
  creds: Object.new
185
185
  }
186
- RpcServer.new(**opts)
186
+ new_rpc_server_for_testing(**opts)
187
187
  end
188
188
  expect(&blk).to raise_error
189
189
  end
@@ -192,7 +192,7 @@ describe GRPC::RpcServer do
192
192
  describe '#stopped?' do
193
193
  before(:each) do
194
194
  opts = { server_args: { a_channel_arg: 'an_arg' }, poll_period: 1.5 }
195
- @srv = RpcServer.new(**opts)
195
+ @srv = new_rpc_server_for_testing(**opts)
196
196
  @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
197
197
  end
198
198
 
@@ -224,7 +224,7 @@ describe GRPC::RpcServer do
224
224
  opts = {
225
225
  server_args: { a_channel_arg: 'an_arg' }
226
226
  }
227
- r = RpcServer.new(**opts)
227
+ r = new_rpc_server_for_testing(**opts)
228
228
  expect(r.running?).to be(false)
229
229
  end
230
230
 
@@ -233,7 +233,7 @@ describe GRPC::RpcServer do
233
233
  server_args: { a_channel_arg: 'an_arg' },
234
234
  poll_period: 2
235
235
  }
236
- r = RpcServer.new(**opts)
236
+ r = new_rpc_server_for_testing(**opts)
237
237
  r.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
238
238
  expect { r.run }.to raise_error(RuntimeError)
239
239
  end
@@ -243,7 +243,7 @@ describe GRPC::RpcServer do
243
243
  server_args: { a_channel_arg: 'an_arg' },
244
244
  poll_period: 2.5
245
245
  }
246
- r = RpcServer.new(**opts)
246
+ r = new_rpc_server_for_testing(**opts)
247
247
  r.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
248
248
  r.handle(EchoService)
249
249
  t = Thread.new { r.run }
@@ -257,7 +257,7 @@ describe GRPC::RpcServer do
257
257
  describe '#handle' do
258
258
  before(:each) do
259
259
  @opts = { server_args: { a_channel_arg: 'an_arg' }, poll_period: 1 }
260
- @srv = RpcServer.new(**@opts)
260
+ @srv = new_rpc_server_for_testing(**@opts)
261
261
  @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
262
262
  end
263
263
 
@@ -303,7 +303,7 @@ describe GRPC::RpcServer do
303
303
  server_opts = {
304
304
  poll_period: 1
305
305
  }
306
- @srv = RpcServer.new(**server_opts)
306
+ @srv = new_rpc_server_for_testing(**server_opts)
307
307
  server_port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
308
308
  @host = "localhost:#{server_port}"
309
309
  @ch = GRPC::Core::Channel.new(@host, nil, :this_channel_is_insecure)
@@ -474,7 +474,7 @@ describe GRPC::RpcServer do
474
474
  poll_period: 1,
475
475
  max_waiting_requests: 1
476
476
  }
477
- alt_srv = RpcServer.new(**opts)
477
+ alt_srv = new_rpc_server_for_testing(**opts)
478
478
  alt_srv.handle(SlowService)
479
479
  alt_port = alt_srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
480
480
  alt_host = "0.0.0.0:#{alt_port}"
@@ -538,7 +538,7 @@ describe GRPC::RpcServer do
538
538
  poll_period: 1,
539
539
  connect_md_proc: test_md_proc
540
540
  }
541
- @srv = RpcServer.new(**server_opts)
541
+ @srv = new_rpc_server_for_testing(**server_opts)
542
542
  alt_port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
543
543
  @alt_host = "0.0.0.0:#{alt_port}"
544
544
  end
@@ -573,7 +573,7 @@ describe GRPC::RpcServer do
573
573
  server_opts = {
574
574
  poll_period: 1
575
575
  }
576
- @srv = RpcServer.new(**server_opts)
576
+ @srv = new_rpc_server_for_testing(**server_opts)
577
577
  alt_port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
578
578
  @alt_host = "0.0.0.0:#{alt_port}"
579
579
  end
@@ -624,7 +624,7 @@ describe GRPC::RpcServer do
624
624
  server_opts = {
625
625
  poll_period: 1
626
626
  }
627
- @srv = RpcServer.new(**server_opts)
627
+ @srv = new_rpc_server_for_testing(**server_opts)
628
628
  alt_port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
629
629
  @alt_host = "0.0.0.0:#{alt_port}"
630
630
 
@@ -19,6 +19,7 @@ require_relative '../pb/src/proto/grpc/testing/messages_pb'
19
19
  require 'google/protobuf/well_known_types'
20
20
 
21
21
  include GRPC::Core
22
+ include GRPC::Spec::Helpers
22
23
 
23
24
  describe 'conversion from a status struct to a google protobuf status' do
24
25
  it 'fails if the input is not a status struct' do
@@ -150,7 +151,7 @@ GoogleRpcStatusTestStub = GoogleRpcStatusTestService.rpc_stub_class
150
151
 
151
152
  describe 'receving a google rpc status from a remote endpoint' do
152
153
  def start_server(encoded_rpc_status)
153
- @srv = GRPC::RpcServer.new(pool_size: 1)
154
+ @srv = new_rpc_server_for_testing(pool_size: 1)
154
155
  @server_port = @srv.add_http2_port('localhost:0',
155
156
  :this_port_is_insecure)
156
157
  @srv.handle(GoogleRpcStatusTestService.new(encoded_rpc_status))
@@ -238,7 +239,7 @@ NoStatusDetailsBinTestServiceStub = NoStatusDetailsBinTestService.rpc_stub_class
238
239
 
239
240
  describe 'when the endpoint doesnt send grpc-status-details-bin' do
240
241
  def start_server
241
- @srv = GRPC::RpcServer.new(pool_size: 1)
242
+ @srv = new_rpc_server_for_testing(pool_size: 1)
242
243
  @server_port = @srv.add_http2_port('localhost:0',
243
244
  :this_port_is_insecure)
244
245
  @srv.handle(NoStatusDetailsBinTestService)
@@ -192,7 +192,7 @@ describe Grpc::Health::Checker do
192
192
  server_opts = {
193
193
  poll_period: 1
194
194
  }
195
- @srv = RpcServer.new(**server_opts)
195
+ @srv = new_rpc_server_for_testing(**server_opts)
196
196
  server_port = @srv.add_http2_port(server_host, :this_port_is_insecure)
197
197
  @host = "localhost:#{server_port}"
198
198
  @ch = GRPC::Core::Channel.new(@host, nil, :this_channel_is_insecure)
@@ -30,12 +30,12 @@ describe Server do
30
30
 
31
31
  describe '#start' do
32
32
  it 'runs without failing' do
33
- blk = proc { Server.new(nil).start }
33
+ blk = proc { new_core_server_for_testing(nil).start }
34
34
  expect(&blk).to_not raise_error
35
35
  end
36
36
 
37
37
  it 'fails if the server is closed' do
38
- s = Server.new(nil)
38
+ s = new_core_server_for_testing(nil)
39
39
  s.close
40
40
  expect { s.start }.to raise_error(RuntimeError)
41
41
  end
@@ -85,7 +85,7 @@ describe Server do
85
85
  describe 'for insecure servers' do
86
86
  it 'runs without failing' do
87
87
  blk = proc do
88
- s = Server.new(nil)
88
+ s = new_core_server_for_testing(nil)
89
89
  s.add_http2_port('localhost:0', :this_port_is_insecure)
90
90
  s.close
91
91
  end
@@ -93,7 +93,7 @@ describe Server do
93
93
  end
94
94
 
95
95
  it 'fails if the server is closed' do
96
- s = Server.new(nil)
96
+ s = new_core_server_for_testing(nil)
97
97
  s.close
98
98
  blk = proc do
99
99
  s.add_http2_port('localhost:0', :this_port_is_insecure)
@@ -106,7 +106,7 @@ describe Server do
106
106
  let(:cert) { create_test_cert }
107
107
  it 'runs without failing' do
108
108
  blk = proc do
109
- s = Server.new(nil)
109
+ s = new_core_server_for_testing(nil)
110
110
  s.add_http2_port('localhost:0', cert)
111
111
  s.close
112
112
  end
@@ -114,7 +114,7 @@ describe Server do
114
114
  end
115
115
 
116
116
  it 'fails if the server is closed' do
117
- s = Server.new(nil)
117
+ s = new_core_server_for_testing(nil)
118
118
  s.close
119
119
  blk = proc { s.add_http2_port('localhost:0', cert) }
120
120
  expect(&blk).to raise_error(RuntimeError)
@@ -124,7 +124,7 @@ describe Server do
124
124
 
125
125
  shared_examples '#new' do
126
126
  it 'takes nil channel args' do
127
- expect { Server.new(nil) }.to_not raise_error
127
+ expect { new_core_server_for_testing(nil) }.to_not raise_error
128
128
  end
129
129
 
130
130
  it 'does not take a hash with bad keys as channel args' do
@@ -175,14 +175,14 @@ describe Server do
175
175
 
176
176
  describe '#new with an insecure channel' do
177
177
  def construct_with_args(a)
178
- proc { Server.new(a) }
178
+ proc { new_core_server_for_testing(a) }
179
179
  end
180
180
 
181
181
  it_behaves_like '#new'
182
182
  end
183
183
 
184
184
  def start_a_server
185
- s = Server.new(nil)
185
+ s = new_core_server_for_testing(nil)
186
186
  s.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
187
187
  s.start
188
188
  s
@@ -31,7 +31,7 @@ module GRPC
31
31
  #
32
32
  def build_rpc_server(server_opts: {},
33
33
  client_opts: {})
34
- @server = RpcServer.new({ poll_period: 1 }.merge(server_opts))
34
+ @server = new_rpc_server_for_testing({ poll_period: 1 }.merge(server_opts))
35
35
  @port = @server.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
36
36
  @host = "0.0.0.0:#{@port}"
37
37
  @client_opts = client_opts
@@ -68,6 +68,40 @@ module GRPC
68
68
  opts ||= @client_opts
69
69
  klass.new(host, :this_channel_is_insecure, **opts)
70
70
  end
71
+
72
+ ##
73
+ # Build an RPCServer for use in tests. Adds args
74
+ # that are useful for all tests.
75
+ #
76
+ # @param [Hash] server_opts
77
+ #
78
+ def new_rpc_server_for_testing(server_opts = {})
79
+ server_opts[:server_args] ||= {}
80
+ update_server_args_hash(server_opts[:server_args])
81
+ RpcServer.new(**server_opts)
82
+ end
83
+
84
+ ##
85
+ # Build an GRPC::Core::Server for use in tests. Adds args
86
+ # that are useful for all tests.
87
+ #
88
+ # @param [Hash] server_args
89
+ #
90
+ def new_core_server_for_testing(server_args)
91
+ server_args.nil? && server_args = {}
92
+ update_server_args_hash(server_args)
93
+ GRPC::Core::Server.new(server_args)
94
+ end
95
+
96
+ def update_server_args_hash(server_args)
97
+ so_reuseport_arg = 'grpc.so_reuseport'
98
+ unless server_args[so_reuseport_arg].nil?
99
+ fail 'Unexpected. grpc.so_reuseport already set.'
100
+ end
101
+ # Run tests without so_reuseport to eliminate the chance of
102
+ # cross-talk.
103
+ server_args[so_reuseport_arg] = 0
104
+ end
71
105
  end
72
106
  end
73
107
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.7
4
+ version: 1.9.0.pre1
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -252,6 +252,7 @@ files:
252
252
  - src/ruby/lib/grpc/2.2/grpc_c.so
253
253
  - src/ruby/lib/grpc/2.3/grpc_c.so
254
254
  - src/ruby/lib/grpc/2.4/grpc_c.so
255
+ - src/ruby/lib/grpc/2.5/grpc_c.so
255
256
  - src/ruby/lib/grpc/core/time_consts.rb
256
257
  - src/ruby/lib/grpc/errors.rb
257
258
  - src/ruby/lib/grpc/generic/active_call.rb
@@ -332,12 +333,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
332
333
  version: '2.0'
333
334
  - - "<"
334
335
  - !ruby/object:Gem::Version
335
- version: '2.5'
336
+ version: '2.6'
336
337
  required_rubygems_version: !ruby/object:Gem::Requirement
337
338
  requirements:
338
- - - ">="
339
+ - - ">"
339
340
  - !ruby/object:Gem::Version
340
- version: '0'
341
+ version: 1.3.1
341
342
  requirements: []
342
343
  rubyforge_project:
343
344
  rubygems_version: 2.7.4