Skip to content

Commit 1caa6c9

Browse files
committed
sanity fix
1 parent fe33f5f commit 1caa6c9

4 files changed

Lines changed: 42 additions & 23 deletions

File tree

test/cpp/interop/client.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ int main(int argc, char** argv) {
229229
new grpc::testing::MetadataAndStatusLoggerInterceptorFactory());
230230
}
231231
if (test_case == "max_concurrent_streams_connection_scaling") {
232-
arguments.SetServiceConfigJSON("{\"connectionScaling\":{\"maxConnectionsPerSubchannel\": 2}}");
232+
arguments.SetServiceConfigJSON(
233+
"{\"connectionScaling\":{\"maxConnectionsPerSubchannel\": 2}}");
233234
} else {
234235
std::string service_config_json =
235236
absl::GetFlag(FLAGS_service_config_json);

test/cpp/interop/interop_client.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,14 +1371,15 @@ bool InteropClient::DoMcsConnectionScaling() {
13711371

13721372
StreamingOutputCallRequest request;
13731373
ResponseParameters* response_parameter = request.add_response_parameters();
1374-
response_parameter->mutable_send_client_socket_address_in_response()->set_value(true);
1374+
response_parameter->mutable_send_client_socket_address_in_response()
1375+
->set_value(true);
13751376
StreamingOutputCallResponse response1;
13761377

13771378
if (!stream1->Write(request)) {
13781379
LOG(ERROR) << "DoMcsConnectionScaling(): stream1->Write() failed.";
13791380
return TransientFailureOrAbort();
13801381
}
1381-
1382+
13821383
if (!stream1->Read(&response1)) {
13831384
LOG(ERROR) << "DoMcsConnectionScaling(): stream1->Read() failed.";
13841385
return TransientFailureOrAbort();
@@ -1402,7 +1403,7 @@ bool InteropClient::DoMcsConnectionScaling() {
14021403
if (!stream2->Read(&response2)) {
14031404
LOG(ERROR) << "DoMcsConnectionScaling(): stream2->Read() failed.";
14041405
return TransientFailureOrAbort();
1405-
}
1406+
}
14061407
std::string clientSocketAddressInCall2 = response2.client_socket_address();
14071408

14081409
// The same connection should have been used for both streams.
@@ -1424,7 +1425,7 @@ bool InteropClient::DoMcsConnectionScaling() {
14241425
if (!stream3->Read(&response3)) {
14251426
LOG(ERROR) << "DoMcsConnectionScaling(): stream3->Read() failed.";
14261427
return TransientFailureOrAbort();
1427-
}
1428+
}
14281429
std::string clientSocketAddressInCall3 = response3.client_socket_address();
14291430
GRPC_CHECK(!clientSocketAddressInCall3.empty());
14301431

tools/run_tests/python_utils/jobset.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ def start(self):
310310
# error during the creation of temporary file. By using
311311
# NamedTemporaryFile, we defer the removal of file and directory.
312312
self._logfile = tempfile.NamedTemporaryFile(delete=False)
313-
print('Job ' + self._spec.shortname + ' started with log file ' + self._logfile.name)
313+
print(
314+
"Job "
315+
+ self._spec.shortname
316+
+ " started with log file "
317+
+ self._logfile.name
318+
)
314319
env = dict(os.environ)
315320
env.update(self._spec.environ)
316321
env.update(self._add_env)

tools/run_tests/run_interop_tests.py

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ def cloud_to_cloud_jobspec(
10331033
docker_image=None,
10341034
transport_security="tls",
10351035
manual_cmd_log=None,
1036-
add_env={}
1036+
add_env={},
10371037
):
10381038
"""Creates jobspec for cloud-to-cloud interop test"""
10391039
interop_only_options = [
@@ -1131,7 +1131,11 @@ def cloud_to_cloud_jobspec(
11311131

11321132

11331133
def server_jobspec(
1134-
language, docker_image, transport_security="tls", manual_cmd_log=None, set_max_concurrent_streams_limit=False
1134+
language,
1135+
docker_image,
1136+
transport_security="tls",
1137+
manual_cmd_log=None,
1138+
set_max_concurrent_streams_limit=False,
11351139
):
11361140
"""Create jobspec for running a server"""
11371141
container_name = dockerjob.random_name(
@@ -1809,45 +1813,53 @@ def aggregate_http2_results(stdout):
18091813

18101814
if args.max_concurrent_streams_connection_scaling:
18111815
if not args.use_docker:
1812-
print('MCS connection scaling test can only be run with --use-docker')
1816+
print(
1817+
"MCS connection scaling test can only be run with --use-docker"
1818+
)
18131819
else:
18141820
languages_for_mcs_cs = set(
18151821
_LANGUAGES[l]
18161822
for l in _LANGUAGES_WITH_HTTP2_CLIENTS_FOR_HTTP2_SERVER_TEST_CASES
18171823
if "all" in args.language or l in args.language
18181824
)
18191825
if len(languages_for_mcs_cs) > 0:
1820-
if args.server != 'java':
1821-
print('Using java for MCS connection scaling server to be used by all MCS connection scaling clients.')
1826+
if args.server != "java":
1827+
print(
1828+
"Using java for MCS connection scaling server to be used by all MCS connection scaling clients."
1829+
)
18221830
mcs_server_jobspec = server_jobspec(
1823-
_LANGUAGES['java'],
1824-
docker_images.get('java'),
1831+
_LANGUAGES["java"],
1832+
docker_images.get("java"),
18251833
args.transport_security,
18261834
manual_cmd_log=server_manual_cmd_log,
18271835
set_max_concurrent_streams_limit=True,
18281836
)
18291837
mcs_server_job = dockerjob.DockerJob(mcs_server_jobspec)
18301838
time.sleep(30)
1831-
1839+
18321840
for language in languages_for_mcs_cs:
18331841
test_job = cloud_to_cloud_jobspec(
18341842
language,
1835-
'max_concurrent_streams_connection_scaling',
1836-
'java-mcs',
1837-
'localhost',
1843+
"max_concurrent_streams_connection_scaling",
1844+
"java-mcs",
1845+
"localhost",
18381846
mcs_server_job.mapped_port(_DEFAULT_SERVER_PORT),
18391847
docker_image=docker_images.get(str(language)),
18401848
transport_security=args.transport_security,
18411849
manual_cmd_log=client_manual_cmd_log,
1842-
add_env={'GRPC_EXPERIMENTAL_MAX_CONCURRENT_STREAMS_CONNECTION_SCALING': 'true',
1843-
'GRPC_EXPERIMENTS': 'subchannel_connection_scaling',
1844-
'GRPC_VERBOSITY': 'debug',
1845-
'GRPC_TRACE': 'all'},
1850+
add_env={
1851+
"GRPC_EXPERIMENTAL_MAX_CONCURRENT_STREAMS_CONNECTION_SCALING": "true",
1852+
"GRPC_EXPERIMENTS": "subchannel_connection_scaling",
1853+
"GRPC_VERBOSITY": "debug",
1854+
"GRPC_TRACE": "all",
1855+
},
18461856
)
18471857
jobs.append(test_job)
18481858
else:
1849-
print('MCS connection scaling tests will be skipped since none of the supported client languages for MCS connection scaling testcases was specified')
1850-
1859+
print(
1860+
"MCS connection scaling tests will be skipped since none of the supported client languages for MCS connection scaling testcases was specified"
1861+
)
1862+
18511863
if not jobs:
18521864
print("No jobs to run.")
18531865
for image in docker_images.values():

0 commit comments

Comments
 (0)