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
fd4cbb70
Commit
fd4cbb70
authored
7 years ago
by
Alexander Polcyn
Browse files
Options
Downloads
Patches
Plain Diff
cleanup test
parent
7b3629e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ruby/end2end/grpc_class_init_client.rb
+38
-19
38 additions, 19 deletions
src/ruby/end2end/grpc_class_init_client.rb
src/ruby/end2end/grpc_class_init_driver.rb
+8
-6
8 additions, 6 deletions
src/ruby/end2end/grpc_class_init_driver.rb
with
46 additions
and
25 deletions
src/ruby/end2end/grpc_class_init_client.rb
+
38
−
19
View file @
fd4cbb70
...
@@ -60,6 +60,27 @@ def run_gc_stress_test(test_proc)
...
@@ -60,6 +60,27 @@ def run_gc_stress_test(test_proc)
construct_many
(
test_proc
)
construct_many
(
test_proc
)
end
end
def
run_concurrency_stress_test
(
test_proc
)
test_proc
.
call
thds
=
[]
100
.
times
do
thds
<<
Thread
.
new
do
test_proc
.
call
end
end
raise
"something"
end
# default (no gc_stress and no concurrency_stress)
def
run_default_test
(
test_proc
)
thd
=
Thread
.
new
do
test_proc
.
call
end
test_proc
.
call
end
def
get_test_proc
(
grpc_class
)
def
get_test_proc
(
grpc_class
)
case
grpc_class
case
grpc_class
when
'channel'
when
'channel'
...
@@ -89,36 +110,34 @@ end
...
@@ -89,36 +110,34 @@ end
def
main
def
main
grpc_class
=
''
grpc_class
=
''
gc_
stress
=
false
stress
_test
=
''
OptionParser
.
new
do
|
opts
|
OptionParser
.
new
do
|
opts
|
opts
.
on
(
'--grpc_class=P'
,
String
)
do
|
p
|
opts
.
on
(
'--grpc_class=P'
,
String
)
do
|
p
|
grpc_class
=
p
grpc_class
=
p
end
end
opts
.
on
(
'--
gc_
stress=P'
)
do
|
p
|
opts
.
on
(
'--stress
_test
=P'
)
do
|
p
|
gc_
stress
=
p
stress
_test
=
p
end
end
end
.
parse!
end
.
parse!
test_proc
=
get_test_proc
(
grpc_class
)
test_proc
=
get_test_proc
(
grpc_class
)
if
gc_stress
==
'true'
# the different test configs need to be ran
# in separate processes, since each one tests
# clean shutdown in a different way
case
stress_test
when
'gc'
p
'run gc stress'
run_gc_stress_test
(
test_proc
)
run_gc_stress_test
(
test_proc
)
return
when
'concurrency'
end
p
'run concurrency stress'
run_concurrency_stress_test
(
test_proc
)
# test_proc.call
when
''
p
'run default'
thds
=
[]
run_default_test
(
test_proc
)
100
.
times
do
else
thds
<<
Thread
.
new
do
fail
"bad --stress_test=
#{
stress_test
}
param"
test_proc
.
call
sleep
10
end
end
end
#test_proc.call
raise
"something"
thds
.
each
(
&
:join
)
end
end
main
main
This diff is collapsed.
Click to expand it.
src/ruby/end2end/grpc_class_init_driver.rb
+
8
−
6
View file @
fd4cbb70
...
@@ -39,17 +39,17 @@ def main
...
@@ -39,17 +39,17 @@ def main
compression_options )
compression_options )
# there is room for false positives in this test,
# there is room for false positives in this test,
# do
10
runs for each config
to reduce these.
# do
a few
runs for each config
[
true
,
false
].
each
do
|
gc_stress
|
4
.
times
do
10
.
times
do
native_grpc_classes
.
each
do
|
grpc_class
|
native_grpc_classes
.
each
do
|
grpc_class
|
[
''
,
'gc'
,
'concurrency'
].
each
do
|
stress_test_type
|
STDERR
.
puts
'start client'
STDERR
.
puts
'start client'
this_dir
=
File
.
expand_path
(
File
.
dirname
(
__FILE__
))
this_dir
=
File
.
expand_path
(
File
.
dirname
(
__FILE__
))
client_path
=
File
.
join
(
this_dir
,
'grpc_class_init_client.rb'
)
client_path
=
File
.
join
(
this_dir
,
'grpc_class_init_client.rb'
)
client_pid
=
Process
.
spawn
(
RbConfig
.
ruby
,
client_pid
=
Process
.
spawn
(
RbConfig
.
ruby
,
client_path
,
client_path
,
"--grpc_class=
#{
grpc_class
}
"
,
"--grpc_class=
#{
grpc_class
}
"
,
"--
gc_
stress
=
#{
gc_stress
}
"
)
"--stress
_test=
#{
stress_test_type
}
"
)
begin
begin
Timeout
.
timeout
(
10
)
do
Timeout
.
timeout
(
10
)
do
Process
.
wait
(
client_pid
)
Process
.
wait
(
client_pid
)
...
@@ -65,7 +65,9 @@ def main
...
@@ -65,7 +65,9 @@ def main
end
end
client_exit_code
=
$CHILD_STATUS
client_exit_code
=
$CHILD_STATUS
if
client_exit_code
!=
0
# concurrency stress test type is expected to exit with a
# non-zero status due to an exception being raised
if
client_exit_code
!=
0
and
stress_test_type
!=
'concurrency'
fail
"client failed, exit code
#{
client_exit_code
}
"
fail
"client failed, exit code
#{
client_exit_code
}
"
end
end
end
end
...
...
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