You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ph...@apache.org on 2017/12/20 21:30:32 UTC

[08/15] zookeeper git commit: Log and continue executing when a job cannot be reached

Log and continue executing when a job cannot be reached

Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/82524181
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/82524181
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/82524181

Branch: refs/heads/jenkins-tools
Commit: 82524181b32876c997bbc5ee4195f797ac3b8cae
Parents: 10ad89d
Author: Abraham Fine <af...@users.noreply.github.com>
Authored: Mon May 15 15:34:34 2017 -0700
Committer: GitHub <no...@github.com>
Committed: Mon May 15 15:34:34 2017 -0700

----------------------------------------------------------------------
 zk-test-report/zk_test_analyzer.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/82524181/zk-test-report/zk_test_analyzer.py
----------------------------------------------------------------------
diff --git a/zk-test-report/zk_test_analyzer.py b/zk-test-report/zk_test_analyzer.py
index fcd6038..130d744 100644
--- a/zk-test-report/zk_test_analyzer.py
+++ b/zk-test-report/zk_test_analyzer.py
@@ -30,6 +30,7 @@ import time
 import re
 import requests
 from jinja2 import Template
+from simplejson import JSONDecodeError
 
 # If any of these strings appear in the console output, it's a build one should probably ignore
 # for analyzing failed/hanging tests.
@@ -129,7 +130,11 @@ def parse_cli_args(cli_args):
         excluded_builds = []
         if excluded_builds_arg is not None and excluded_builds_arg[i] != "None":
             excluded_builds = [int(x) for x in excluded_builds_arg[i].split(",")]
-        response = requests.get(job_url + "/api/json").json()
+        try:    
+            response = requests.get(job_url + "/api/json").json()
+        except JSONDecodeError:
+            LOG.error("failed to get: " + job_url + "/api/json")
+            continue
         if "activeConfigurations" in response:
             for config in response["activeConfigurations"]:
                 final_expanded_urls.append({'url': config["url"], 'max_builds': max_builds,