test_constants.py
Go to the documentation of this file.
1 # Copyright 2015 gRPC authors.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 """Constants shared among tests throughout RPC Framework."""
15 
16 # Value for maximum duration in seconds that a test is allowed for its actual
17 # behavioral logic, excluding all time spent deliberately waiting in the test.
18 TIME_ALLOWANCE = 10
19 # Value for maximum duration in seconds of RPCs that may time out as part of a
20 # test.
21 SHORT_TIMEOUT = 4
22 # Absurdly large value for maximum duration in seconds for should-not-time-out
23 # RPCs made during tests.
24 LONG_TIMEOUT = 3000
25 # Values to supply on construction of an object that will service RPCs; these
26 # should not be used as the actual timeout values of any RPCs made during tests.
27 DEFAULT_TIMEOUT = 300
28 MAXIMUM_TIMEOUT = 3600
29 
30 # The number of payloads to transmit in streaming tests.
31 STREAM_LENGTH = 200
32 
33 # The size of payloads to transmit in tests.
34 PAYLOAD_SIZE = 256 * 1024 + 17
35 
36 # The concurrency to use in tests of concurrent RPCs that will not create as
37 # many threads as RPCs.
38 RPC_CONCURRENCY = 200
39 
40 # The concurrency to use in tests of concurrent RPCs that will create as many
41 # threads as RPCs.
42 THREAD_CONCURRENCY = 25
43 
44 # The size of thread pools to use in tests.
45 POOL_SIZE = 10


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:31