Simplify ruby class init test (#32307)

pull/32316/head
apolcyn 2 years ago committed by GitHub
parent c6d9a16a71
commit 8734964482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/ruby/end2end/grpc_class_init_client.rb

@ -46,15 +46,14 @@ def run_gc_stress_test(test_proc)
end end
def run_concurrency_stress_test(test_proc) def run_concurrency_stress_test(test_proc)
thds = []
100.times do 100.times do
Thread.new do thds << Thread.new do
test_proc.call test_proc.call
end end
end end
test_proc.call test_proc.call
thds.each(&:join)
fail '(expected) exception thrown while child thread initing class'
end end
# default (no gc_stress and no concurrency_stress) # default (no gc_stress and no concurrency_stress)
@ -139,13 +138,13 @@ def main
# clean shutdown in a different way # clean shutdown in a different way
case stress_test case stress_test
when 'gc' when 'gc'
p 'run gc stress' p "run gc stress: #{grpc_class}"
run_gc_stress_test(test_proc) run_gc_stress_test(test_proc)
when 'concurrency' when 'concurrency'
p 'run concurrency stress' p "run concurrency stress: #{grpc_class}"
run_concurrency_stress_test(test_proc) run_concurrency_stress_test(test_proc)
when '' when ''
p 'run default' p "run default: #{grpc_class}"
run_default_test(test_proc) run_default_test(test_proc)
else else
fail "bad --stress_test=#{stress_test} param" fail "bad --stress_test=#{stress_test} param"

Loading…
Cancel
Save