From 7b042c5793b1477f4a0a1a1ee72796ea53bf88ae Mon Sep 17 00:00:00 2001
From: Nathaniel Manista <nathaniel@google.com>
Date: Mon, 27 Jul 2015 20:59:36 +0000
Subject: [PATCH] Add STREAM_LENGTH and POOL_SIZE to test_constants

Only one of these is used, and in only one place, as of this commit,
but they will be used widely after further development.
---
 src/python/src/grpc/_links/_proto_scenarios.py         | 4 ++--
 src/python/src/grpc/framework/common/test_constants.py | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/python/src/grpc/_links/_proto_scenarios.py b/src/python/src/grpc/_links/_proto_scenarios.py
index ccf3c29782..320c0e0f50 100644
--- a/src/python/src/grpc/_links/_proto_scenarios.py
+++ b/src/python/src/grpc/_links/_proto_scenarios.py
@@ -33,6 +33,7 @@ import abc
 import threading
 
 from grpc._junkdrawer import math_pb2
+from grpc.framework.common import test_constants
 
 
 class ProtoScenario(object):
@@ -219,10 +220,9 @@ class BidirectionallyUnaryScenario(ProtoScenario):
 class BidirectionallyStreamingScenario(ProtoScenario):
   """A scenario that transmits no protocol buffers in either direction."""
 
-  _STREAM_LENGTH = 200
   _REQUESTS = tuple(
       math_pb2.DivArgs(dividend=59 + index, divisor=7 + index)
-      for index in range(_STREAM_LENGTH))
+      for index in range(test_constants.STREAM_LENGTH))
 
   def __init__(self):
     self._lock = threading.Lock()
diff --git a/src/python/src/grpc/framework/common/test_constants.py b/src/python/src/grpc/framework/common/test_constants.py
index 237b8754ed..3126d0d82c 100644
--- a/src/python/src/grpc/framework/common/test_constants.py
+++ b/src/python/src/grpc/framework/common/test_constants.py
@@ -35,3 +35,9 @@ SHORT_TIMEOUT = 4
 # Absurdly large value for maximum duration in seconds for should-not-time-out
 # RPCs made during tests.
 LONG_TIMEOUT = 3000
+
+# The number of payloads to transmit in streaming tests.
+STREAM_LENGTH = 200
+
+# The size of thread pools to use in tests.
+POOL_SIZE = 10
-- 
GitLab