spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwend...@apache.org
Subject git commit: [SPARK-3076] [Jenkins] catch & report test timeouts
Date Sat, 16 Aug 2014 19:43:45 GMT
Repository: spark
Updated Branches:
  refs/heads/master b4a05928e -> 4bdfaa16f


[SPARK-3076] [Jenkins] catch & report test timeouts

* Remove unused code to get jq
* Set timeout on tests and report gracefully on them

Author: Nicholas Chammas <nicholas.chammas@gmail.com>

Closes #1974 from nchammas/master and squashes the following commits:

d1f1b6b [Nicholas Chammas] set timeout to realistic number
8b1ea41 [Nicholas Chammas] fix formatting
279526e [Nicholas Chammas] [SPARK-3076] catch & report test timeouts


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

Branch: refs/heads/master
Commit: 4bdfaa16fce399bd97c98858151246b3b02f350f
Parents: b4a0592
Author: Nicholas Chammas <nicholas.chammas@gmail.com>
Authored: Sat Aug 16 12:35:59 2014 -0700
Committer: Patrick Wendell <pwendell@gmail.com>
Committed: Sat Aug 16 12:43:36 2014 -0700

----------------------------------------------------------------------
 dev/run-tests-jenkins | 48 +++++++++++++++++++---------------------------
 1 file changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/4bdfaa16/dev/run-tests-jenkins
----------------------------------------------------------------------
diff --git a/dev/run-tests-jenkins b/dev/run-tests-jenkins
index 721f09b..31506e2 100755
--- a/dev/run-tests-jenkins
+++ b/dev/run-tests-jenkins
@@ -26,27 +26,17 @@
 FWDIR="$(cd `dirname $0`/..; pwd)"
 cd "$FWDIR"
 
-function get_jq () {
-  # Get jq so we can parse some JSON, man.
-  # Essential if we want to do anything with the GitHub API responses.
-  local JQ_EXECUTABLE_URL="http://stedolan.github.io/jq/download/linux64/jq"
-
-  echo "Fetching jq from ${JQ_EXECUTABLE_URL}"
-  
-  curl --silent --output "$FWDIR/dev/jq" "$JQ_EXECUTABLE_URL"
-  local curl_status=$?
-
-  if [ $curl_status -ne 0 ]; then
-      echo "Failed to get jq." >&2
-      return $curl_status
-  fi
-
-  chmod u+x "$FWDIR/dev/jq"
-}
-
 COMMENTS_URL="https://api.github.com/repos/apache/spark/issues/$ghprbPullId/comments"
 PULL_REQUEST_URL="https://github.com/apache/spark/pull/$ghprbPullId"
 
+COMMIT_URL="https://github.com/apache/spark/commit/${ghprbActualCommit}"
+# GitHub doesn't auto-link short hashes when submitted via the API, unfortunately. :(
+SHORT_COMMIT_HASH="${ghprbActualCommit:0:7}"
+
+# NOTE: Jenkins will kill the whole build after 120 minutes.
+#       Tests are a large part of that, but not all of it.
+TESTS_TIMEOUT="120m"
+
 function post_message () {
   local message=$1
   local data="{\"body\": \"$message\"}"
@@ -96,10 +86,6 @@ function post_message () {
   fi
 }
 
-COMMIT_URL="https://github.com/apache/spark/commit/${ghprbActualCommit}"
-# GitHub doesn't auto-link short hashes when submitted via the API, unfortunately. :(
-short_commit_hash=${ghprbActualCommit:0:7}
-
 # check PR merge-ability and check for new public classes
 {
   if [ "$sha1" == "$ghprbActualCommit" ]; then
@@ -138,7 +124,7 @@ short_commit_hash=${ghprbActualCommit:0:7}
 {
   start_message="\
   [QA tests have started](${BUILD_URL}consoleFull) for \
-  PR $ghprbPullId at commit [\`${short_commit_hash}\`](${COMMIT_URL})."
+  PR $ghprbPullId at commit [\`${SHORT_COMMIT_HASH}\`](${COMMIT_URL})."
   
   start_message="${start_message}\n${merge_note}"
   # start_message="${start_message}\n${public_classes_note}"
@@ -148,13 +134,19 @@ short_commit_hash=${ghprbActualCommit:0:7}
 
 # run tests
 {
-  ./dev/run-tests
+  timeout "${TESTS_TIMEOUT}" ./dev/run-tests
   test_result="$?"
 
-  if [ "$test_result" -eq "0" ]; then
-    test_result_note=" * This patch **passes** unit tests."
+  if [ "$test_result" -eq "124" ]; then
+    fail_message="**Tests timed out** after a configured wait of \`${TESTS_TIMEOUT}\`."
+    post_message "$fail_message"
+    exit $test_result
   else
-    test_result_note=" * This patch **fails** unit tests."
+    if [ "$test_result" -eq "0" ]; then
+      test_result_note=" * This patch **passes** unit tests."
+    else
+      test_result_note=" * This patch **fails** unit tests."
+    fi
   fi
 }
 
@@ -162,7 +154,7 @@ short_commit_hash=${ghprbActualCommit:0:7}
 {
   result_message="\
   [QA tests have finished](${BUILD_URL}consoleFull) for \
-  PR $ghprbPullId at commit [\`${short_commit_hash}\`](${COMMIT_URL})."
+  PR $ghprbPullId at commit [\`${SHORT_COMMIT_HASH}\`](${COMMIT_URL})."
 
   result_message="${result_message}\n${test_result_note}"
   result_message="${result_message}\n${merge_note}"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message