diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2016-04-20 15:20:54 -0700 |
---|---|---|
committer | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2016-04-20 15:20:54 -0700 |
commit | 2aec20120020741ee64fcd22042c2e56d4cf0a5b (patch) | |
tree | e74be9be8263a9749d7eb2fc3f07b6bdfea11cd7 /tools | |
parent | f1ec553c3289f2b0b6e7524706c777575bc2af89 (diff) | |
parent | 8149b891bb333fac76aaa4072d2120cbc278a2e4 (diff) |
Merge pull request #6223 from sreecha/set_ulimit
Enable core-dumps for stress clients and servers when launching stress tests in GKE
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gcp/stress_test/run_client.py | 6 | ||||
-rwxr-xr-x | tools/gcp/stress_test/run_server.py | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/tools/gcp/stress_test/run_client.py b/tools/gcp/stress_test/run_client.py index 8f2a9c1530..2004bf6db4 100755 --- a/tools/gcp/stress_test/run_client.py +++ b/tools/gcp/stress_test/run_client.py @@ -31,6 +31,7 @@ import datetime import os import re +import resource import select import subprocess import sys @@ -89,6 +90,11 @@ def run_client(): examining logs). This is the reason why the script waits forever in case of failures """ + # Set the 'core file' size to 'unlimited' so that 'core' files are generated + # if the client crashes (Note: This is not relevant for Java and Go clients) + resource.setrlimit(resource.RLIMIT_CORE, + (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) + env = dict(os.environ) image_type = env['STRESS_TEST_IMAGE_TYPE'] stress_client_cmd = env['STRESS_TEST_CMD'].split() diff --git a/tools/gcp/stress_test/run_server.py b/tools/gcp/stress_test/run_server.py index 796f0923f8..a666ae2900 100755 --- a/tools/gcp/stress_test/run_server.py +++ b/tools/gcp/stress_test/run_server.py @@ -30,6 +30,7 @@ import datetime import os +import resource import select import subprocess import sys @@ -56,6 +57,10 @@ def run_server(): might want to connect to the pod for examining logs). This is the reason why the script waits forever in case of failures. """ + # Set the 'core file' size to 'unlimited' so that 'core' files are generated + # if the server crashes (Note: This is not relevant for Java and Go servers) + resource.setrlimit(resource.RLIMIT_CORE, + (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) # Read the parameters from environment variables env = dict(os.environ) @@ -78,9 +83,10 @@ def run_server(): logfile_name = env.get('LOGFILE_NAME') print('pod_name: %s, project_id: %s, run_id: %s, dataset_id: %s, ' - 'summary_table_id: %s, qps_table_id: %s') % ( - pod_name, project_id, run_id, dataset_id, summary_table_id, - qps_table_id) + 'summary_table_id: %s, qps_table_id: %s') % (pod_name, project_id, + run_id, dataset_id, + summary_table_id, + qps_table_id) bq_helper = BigQueryHelper(run_id, image_type, pod_name, project_id, dataset_id, summary_table_id, qps_table_id) |