kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aw...@apache.org
Subject kudu git commit: build: fix run-test.sh when not retrying all tests
Date Wed, 29 Aug 2018 22:24:13 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 6ec770928 -> b3eb06a01


build: fix run-test.sh when not retrying all tests

This is a follow-up to 5d69deb36925113796cd69f51061b8396b0174fc to clean
up some bash syntax. Notably, if KUDU_RETRY_ALL_FAILED_TESTS is unset,
the following message would be logged to stderr:

  line 77: [: : integer expression expected

Here is a dist-test run with KUDU_RETRY_ALL_FAILED_TESTS unset:
http://dist-test.cloudera.org/job?job_id=awong.1535506444.68746#

...and here is one with it set:
http://dist-test.cloudera.org/job?job_id=awong.1535506280.65606

Change-Id: Icb208194fed255361b2987e945ef91779742d4d7
Reviewed-on: http://gerrit.cloudera.org:8080/11348
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: b3eb06a01efbc8d9a7eb71b4aa3cf732c5567688
Parents: 6ec7709
Author: Andrew Wong <awong@cloudera.com>
Authored: Tue Aug 28 12:11:57 2018 -0700
Committer: Andrew Wong <awong@cloudera.com>
Committed: Wed Aug 29 22:22:50 2018 +0000

----------------------------------------------------------------------
 build-support/run-test.sh | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/b3eb06a0/build-support/run-test.sh
----------------------------------------------------------------------
diff --git a/build-support/run-test.sh b/build-support/run-test.sh
index e8cc996..2d76c2c 100755
--- a/build-support/run-test.sh
+++ b/build-support/run-test.sh
@@ -23,12 +23,11 @@
 # If KUDU_COMPRESS_TEST_OUTPUT is non-empty, then the logs will be
 # gzip-compressed while they are written.
 #
-# If KUDU_FLAKY_TEST_ATTEMPTS is non-zero, and either the test being run
-# matches one of the lines in the file KUDU_FLAKY_TEST_LIST or
-# KUDU_RETRY_ALL_FAILED_TESTS is non-zero, then the test will be retried on
-# failure up to the specified number of times. This can be used in the gerrit
-# workflow to prevent annoying false -1s caused by tests that are known to be
-# flaky in master.
+# If KUDU_FLAKY_TEST_ATTEMPTS is set, and either the test being run matches one
+# of the lines in the file KUDU_FLAKY_TEST_LIST or KUDU_RETRY_ALL_FAILED_TESTS
+# is non-zero, then the test will be retried on failure up to the specified
+# number of times. This can be used in the gerrit workflow to prevent annoying
+# false -1s caused by tests that are known to be flaky in master.
 #
 # If KUDU_REPORT_TEST_RESULTS is non-zero, then tests are reported to the
 # central test server.
@@ -74,19 +73,18 @@ fi
 # Determine whether the user has chosen to retry all failed tests, or whether
 # the test is a known flaky by comparing against the user-specified list.
 TEST_EXECUTION_ATTEMPTS=1
-if [ "$KUDU_RETRY_ALL_FAILED_TESTS" -gt 0 ]; then
-  echo "Will retry on failure"
+if [ -n "$KUDU_RETRY_ALL_FAILED_TESTS" ]; then
+  echo "Will retry all failed tests"
   TEST_IS_RETRYABLE=1
-elif [ -n "KUDU_FLAKY_TEST_LIST" ]; then
-  if [ -f "$KUDU_FLAKY_TEST_LIST" ]; then
-    TEST_IS_RETRYABLE=$(grep --count --line-regexp "$SHORT_TEST_NAME" "$KUDU_FLAKY_TEST_LIST")
+elif [ -n "$KUDU_FLAKY_TEST_LIST" ]; then
+  if [ -f "$KUDU_FLAKY_TEST_LIST" ] && grep -q --count --line-regexp "$SHORT_TEST_NAME"
"$KUDU_FLAKY_TEST_LIST"; then
+    TEST_IS_RETRYABLE=1
   else
     echo "Flaky test list file $KUDU_FLAKY_TEST_LIST missing"
-    TEST_IS_RETRYABLE=0
   fi
 fi
 
-if [ "$TEST_IS_RETRYABLE" -gt 0 ]; then
+if [ -n "$TEST_IS_RETRYABLE" ]; then
   TEST_EXECUTION_ATTEMPTS=${KUDU_FLAKY_TEST_ATTEMPTS:-1}
   echo $TEST_NAME is a retryable test. Will attempt running it
   echo up to $TEST_EXECUTION_ATTEMPTS times.


Mime
View raw message