Skip to content

Commit c134909

Browse files
authored
Merge pull request grpc#22299 from ericgribkoff/more_logging
Increase logging in xds test suite
2 parents 67ca550 + 14e79b2 commit c134909

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

tools/internal_ci/linux/grpc_xds.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Location of the continuous shell script in repository.
1818
build_file: "grpc/tools/internal_ci/linux/grpc_bazel.sh"
19-
timeout_mins: 60
19+
timeout_mins: 90
2020
env_vars {
2121
key: "BAZEL_SCRIPT"
2222
value: "tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh"

tools/internal_ci/linux/grpc_xds_bazel_test_in_docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ bazel build test/cpp/interop:xds_interop_client
5252
--project_id=grpc-testing \
5353
--gcp_suffix=$(date '+%s') \
5454
--verbose \
55-
--client_cmd='bazel-bin/test/cpp/interop/xds_interop_client --server=xds-experimental:///{server_uri} --stats_port={stats_port} --qps={qps}'
55+
--client_cmd='GRPC_VERBOSITY=debug GRPC_TRACE=xds,xds_client bazel-bin/test/cpp/interop/xds_interop_client --server=xds-experimental:///{server_uri} --stats_port={stats_port} --qps={qps}'

tools/run_tests/run_xds_tests.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
logger = logging.getLogger()
3636
console_handler = logging.StreamHandler()
37+
formatter = logging.Formatter(fmt='%(asctime)s: %(levelname)-8s %(message)s')
38+
console_handler.setFormatter(formatter)
3739
logger.addHandler(console_handler)
3840

3941

@@ -231,6 +233,7 @@ def wait_until_all_rpcs_go_to_given_backends(backends,
231233

232234

233235
def test_backends_restart(gcp, backend_service, instance_group):
236+
logger.info('Running test_backends_restart')
234237
instance_names = get_instance_names(gcp, instance_group)
235238
num_instances = len(instance_names)
236239
start_time = time.time()
@@ -261,6 +264,7 @@ def test_backends_restart(gcp, backend_service, instance_group):
261264
def test_change_backend_service(gcp, original_backend_service, instance_group,
262265
alternate_backend_service,
263266
same_zone_instance_group):
267+
logger.info('Running test_change_backend_service')
264268
original_backend_instances = get_instance_names(gcp, instance_group)
265269
alternate_backend_instances = get_instance_names(gcp,
266270
same_zone_instance_group)
@@ -286,6 +290,7 @@ def test_change_backend_service(gcp, original_backend_service, instance_group,
286290
def test_new_instance_group_receives_traffic(gcp, backend_service,
287291
instance_group,
288292
same_zone_instance_group):
293+
logger.info('Running test_new_instance_group_receives_traffic')
289294
instance_names = get_instance_names(gcp, instance_group)
290295
wait_until_all_rpcs_go_to_given_backends(instance_names,
291296
_WAIT_FOR_STATS_SEC)
@@ -306,6 +311,7 @@ def test_new_instance_group_receives_traffic(gcp, backend_service,
306311

307312

308313
def test_ping_pong(gcp, backend_service, instance_group):
314+
logger.info('Running test_ping_pong')
309315
wait_for_healthy_backends(gcp, backend_service, instance_group)
310316
instance_names = get_instance_names(gcp, instance_group)
311317
wait_until_all_rpcs_go_to_given_backends(instance_names,
@@ -314,6 +320,7 @@ def test_ping_pong(gcp, backend_service, instance_group):
314320

315321
def test_remove_instance_group(gcp, backend_service, instance_group,
316322
same_zone_instance_group):
323+
logger.info('Running test_remove_instance_group')
317324
try:
318325
patch_backend_instances(gcp,
319326
backend_service,
@@ -339,6 +346,7 @@ def test_remove_instance_group(gcp, backend_service, instance_group,
339346

340347

341348
def test_round_robin(gcp, backend_service, instance_group):
349+
logger.info('Running test_round_robin')
342350
wait_for_healthy_backends(gcp, backend_service, instance_group)
343351
instance_names = get_instance_names(gcp, instance_group)
344352
threshold = 1
@@ -360,6 +368,9 @@ def test_round_robin(gcp, backend_service, instance_group):
360368
def test_secondary_locality_gets_no_requests_on_partial_primary_failure(
361369
gcp, backend_service, primary_instance_group,
362370
secondary_zone_instance_group):
371+
logger.info(
372+
'Running test_secondary_locality_gets_no_requests_on_partial_primary_failure'
373+
)
363374
try:
364375
patch_backend_instances(
365376
gcp, backend_service,
@@ -386,6 +397,8 @@ def test_secondary_locality_gets_no_requests_on_partial_primary_failure(
386397
def test_secondary_locality_gets_requests_on_primary_failure(
387398
gcp, backend_service, primary_instance_group,
388399
secondary_zone_instance_group):
400+
logger.info(
401+
'Running test_secondary_locality_gets_requests_on_primary_failure')
389402
try:
390403
patch_backend_instances(
391404
gcp, backend_service,
@@ -458,6 +471,7 @@ def create_instance_template(gcp, name, network, source_image):
458471
}
459472
}
460473

474+
logger.debug('Sending GCP request with body=%s', config)
461475
result = gcp.compute.instanceTemplates().insert(project=gcp.project,
462476
body=config).execute()
463477
wait_for_global_operation(gcp, result['name'])
@@ -475,6 +489,7 @@ def add_instance_group(gcp, zone, name, size):
475489
}]
476490
}
477491

492+
logger.debug('Sending GCP request with body=%s', config)
478493
result = gcp.compute.instanceGroupManagers().insert(project=gcp.project,
479494
zone=zone,
480495
body=config).execute()
@@ -496,6 +511,7 @@ def create_health_check(gcp, name):
496511
'portName': 'grpc'
497512
}
498513
}
514+
logger.debug('Sending GCP request with body=%s', config)
499515
result = gcp.compute.healthChecks().insert(project=gcp.project,
500516
body=config).execute()
501517
wait_for_global_operation(gcp, result['name'])
@@ -512,6 +528,7 @@ def create_health_check_firewall_rule(gcp, name):
512528
'sourceRanges': ['35.191.0.0/16', '130.211.0.0/22'],
513529
'targetTags': ['allow-health-checks'],
514530
}
531+
logger.debug('Sending GCP request with body=%s', config)
515532
result = gcp.compute.firewalls().insert(project=gcp.project,
516533
body=config).execute()
517534
wait_for_global_operation(gcp, result['name'])
@@ -527,6 +544,7 @@ def add_backend_service(gcp, name):
527544
'portName': 'grpc',
528545
'protocol': 'HTTP2'
529546
}
547+
logger.debug('Sending GCP request with body=%s', config)
530548
result = gcp.compute.backendServices().insert(project=gcp.project,
531549
body=config).execute()
532550
wait_for_global_operation(gcp, result['name'])
@@ -548,6 +566,7 @@ def create_url_map(gcp, name, backend_service, host_name):
548566
'pathMatcher': _PATH_MATCHER_NAME
549567
}]
550568
}
569+
logger.debug('Sending GCP request with body=%s', config)
551570
result = gcp.compute.urlMaps().insert(project=gcp.project,
552571
body=config).execute()
553572
wait_for_global_operation(gcp, result['name'])
@@ -559,6 +578,7 @@ def create_target_http_proxy(gcp, name):
559578
'name': name,
560579
'url_map': gcp.url_map.url,
561580
}
581+
logger.debug('Sending GCP request with body=%s', config)
562582
result = gcp.compute.targetHttpProxies().insert(project=gcp.project,
563583
body=config).execute()
564584
wait_for_global_operation(gcp, result['name'])
@@ -574,6 +594,7 @@ def create_global_forwarding_rule(gcp, name, ip, port):
574594
'network': args.network,
575595
'target': gcp.target_http_proxy.url,
576596
}
597+
logger.debug('Sending GCP request with body=%s', config)
577598
result = gcp.compute.globalForwardingRules().insert(project=gcp.project,
578599
body=config).execute()
579600
wait_for_global_operation(gcp, result['name'])
@@ -676,6 +697,7 @@ def patch_backend_instances(gcp,
676697
'maxRate': 1 if balancing_mode == 'RATE' else None
677698
} for instance_group in instance_groups],
678699
}
700+
logger.debug('Sending GCP request with body=%s', config)
679701
result = gcp.compute.backendServices().patch(
680702
project=gcp.project, backendService=backend_service.name,
681703
body=config).execute()
@@ -711,6 +733,7 @@ def patch_url_map_backend_service(gcp, backend_service):
711733
'defaultService': backend_service.url,
712734
}]
713735
}
736+
logger.debug('Sending GCP request with body=%s', config)
714737
result = gcp.compute.urlMaps().patch(project=gcp.project,
715738
urlMap=gcp.url_map.name,
716739
body=config).execute()

0 commit comments

Comments
 (0)