Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
20457a1f
Commit
20457a1f
authored
8 years ago
by
Alexander Polcyn
Browse files
Options
Downloads
Patches
Plain Diff
clean up pool unit tests
parent
269e6ccb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ruby/spec/generic/rpc_server_pool_spec.rb
+4
-14
4 additions, 14 deletions
src/ruby/spec/generic/rpc_server_pool_spec.rb
with
4 additions
and
14 deletions
src/ruby/spec/generic/rpc_server_pool_spec.rb
+
4
−
14
View file @
20457a1f
...
...
@@ -55,7 +55,7 @@ describe GRPC::Pool do
it
'it stops being ready after all workers jobs waiting or running'
do
p
=
Pool
.
new
(
5
)
p
.
start
job
=
proc
{
sleep
(
3
)
}
# sleep so workers busy when done scheduling
job
=
proc
{
sleep
(
5
)
}
# sleep so workers busy when done scheduling
5
.
times
do
expect
(
p
.
ready_for_work?
).
to
be
(
true
)
p
.
schedule
(
&
job
)
...
...
@@ -63,7 +63,7 @@ describe GRPC::Pool do
expect
(
p
.
ready_for_work?
).
to
be
(
false
)
end
it
'it
d
ec
reases as jobs are run
'
do
it
'it
b
ec
omes ready again after jobs complete
'
do
p
=
Pool
.
new
(
5
)
p
.
start
job
=
proc
{}
...
...
@@ -72,7 +72,7 @@ describe GRPC::Pool do
p
.
schedule
(
&
job
)
end
expect
(
p
.
ready_for_work?
).
to
be
(
false
)
sleep
2
# give the pool time do get at least one task done
sleep
5
# give the pool time do get at least one task done
expect
(
p
.
ready_for_work?
).
to
be
(
true
)
end
end
...
...
@@ -95,7 +95,7 @@ describe GRPC::Pool do
p
.
stop
end
it
'it throws an error if all o
p
f the workers have tasks to do'
do
it
'it throws an error if all of the workers have tasks to do'
do
p
=
Pool
.
new
(
5
)
p
.
start
job
=
proc
{}
...
...
@@ -129,16 +129,6 @@ describe GRPC::Pool do
end
describe
'#start'
do
it
'runs pre-scheduled jobs'
do
p
=
Pool
.
new
(
5
)
p
.
start
o
,
q
=
Object
.
new
,
Queue
.
new
n
=
5
# arbitrary
n
.
times
{
p
.
schedule
(
o
,
&
q
.
method
(
:push
))
}
n
.
times
{
expect
(
q
.
pop
).
to
be
(
o
)
}
p
.
stop
end
it
'runs jobs as they are scheduled'
do
p
=
Pool
.
new
(
5
)
o
,
q
=
Object
.
new
,
Queue
.
new
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment