grpc 1.2.5-x86-linux → 1.3.4-x86-linux

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.

@@ -52,28 +52,31 @@ describe GRPC::Pool do
52
52
  expect(p.ready_for_work?).to be(false)
53
53
  end
54
54
 
55
- it 'it stops being ready after all workers jobs waiting or running' do
55
+ it 'it stops being ready after all workers are busy' do
56
56
  p = Pool.new(5)
57
57
  p.start
58
- job = proc { sleep(3) } # sleep so workers busy when done scheduling
59
- 5.times do
60
- expect(p.ready_for_work?).to be(true)
61
- p.schedule(&job)
58
+
59
+ wait_mu = Mutex.new
60
+ wait_cv = ConditionVariable.new
61
+ wait = true
62
+
63
+ job = proc do
64
+ wait_mu.synchronize do
65
+ wait_cv.wait(wait_mu) while wait
66
+ end
62
67
  end
63
- expect(p.ready_for_work?).to be(false)
64
- end
65
68
 
66
- it 'it becomes ready again after jobs complete' do
67
- p = Pool.new(5)
68
- p.start
69
- job = proc {}
70
69
  5.times do
71
70
  expect(p.ready_for_work?).to be(true)
72
71
  p.schedule(&job)
73
72
  end
73
+
74
74
  expect(p.ready_for_work?).to be(false)
75
- sleep 5 # give the pool time do get at least one task done
76
- expect(p.ready_for_work?).to be(true)
75
+
76
+ wait_mu.synchronize do
77
+ wait = false
78
+ wait_cv.broadcast
79
+ end
77
80
  end
78
81
  end
79
82
 
@@ -105,13 +108,20 @@ describe GRPC::Pool do
105
108
  it 'stops jobs when there are long running jobs' do
106
109
  p = Pool.new(1)
107
110
  p.start
108
- o, q = Object.new, Queue.new
111
+
112
+ wait_forever_mu = Mutex.new
113
+ wait_forever_cv = ConditionVariable.new
114
+ wait_forever = true
115
+
116
+ job_running = Queue.new
109
117
  job = proc do
110
- sleep(5) # long running
111
- q.push(o)
118
+ job_running.push(Object.new)
119
+ wait_forever_mu.synchronize do
120
+ wait_forever_cv.wait while wait_forever
121
+ end
112
122
  end
113
123
  p.schedule(&job)
114
- sleep(1) # should ensure the long job gets scheduled
124
+ job_running.pop
115
125
  expect { p.stop }.not_to raise_error
116
126
  end
117
127
  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.2.5
4
+ version: 1.3.4
5
5
  platform: x86-linux
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2017-04-20 00:00:00.000000000 Z
11
+ date: 2017-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -261,6 +261,7 @@ files:
261
261
  - src/ruby/pb/test/server.rb
262
262
  - src/ruby/spec/call_credentials_spec.rb
263
263
  - src/ruby/spec/call_spec.rb
264
+ - src/ruby/spec/channel_connection_spec.rb
264
265
  - src/ruby/spec/channel_credentials_spec.rb
265
266
  - src/ruby/spec/channel_spec.rb
266
267
  - src/ruby/spec/client_server_spec.rb
@@ -307,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
308
  version: '0'
308
309
  requirements: []
309
310
  rubyforge_project:
310
- rubygems_version: 2.6.11
311
+ rubygems_version: 2.6.12
311
312
  signing_key:
312
313
  specification_version: 4
313
314
  summary: GRPC system in Ruby
@@ -332,6 +333,7 @@ test_files:
332
333
  - src/ruby/spec/time_consts_spec.rb
333
334
  - src/ruby/spec/channel_credentials_spec.rb
334
335
  - src/ruby/spec/call_credentials_spec.rb
336
+ - src/ruby/spec/channel_connection_spec.rb
335
337
  - src/ruby/spec/server_spec.rb
336
338
  - src/ruby/spec/error_sanity_spec.rb
337
339
  - src/ruby/spec/compression_options_spec.rb