Fix stdout handling in jobset.py (#27493)

* Fix stdout handling in jobset.py

* Apparently ascii was a bad assumption

* Or how about this

* Just ignore non-utf8 characters
pull/27589/head
Richard Belleville 4 years ago committed by GitHub
parent be65f0bf1e
commit 2c889a9921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/run_tests/python_utils/jobset.py
  2. 2
      tools/run_tests/python_utils/upload_test_results.py

@ -357,7 +357,7 @@ class Job(object):
if measure_cpu_costs:
m = re.search(
r'real\s+([0-9.]+)\nuser\s+([0-9.]+)\nsys\s+([0-9.]+)',
stdout())
(stdout()).decode("utf8", errors="replace"))
real = float(m.group(1))
user = float(m.group(2))
sys = float(m.group(3))

@ -88,7 +88,7 @@ def _get_build_metadata(test_results):
def _insert_rows_with_retries(bq, bq_table, bq_rows):
"""Insert rows to bq table. Retry on error."""
# BigQuery sometimes fails with large uploads, so batch 1,000 rows at a time.
for i in range((len(bq_rows) / 1000) + 1):
for i in range((len(bq_rows) // 1000) + 1):
max_retries = 3
for attempt in range(max_retries):
if big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET_ID,

Loading…
Cancel
Save