You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2017/08/25 18:44:14 UTC

kudu git commit: Bump test timeout for flex_partitioning-itest

Repository: kudu
Updated Branches:
  refs/heads/master 3d42a264c -> c77d70f3e


Bump test timeout for flex_partitioning-itest

In precommit runs, this test is sharded 8 ways so it never has issues with
timeouts. However, in some Jenkins builds that don't use dist-test,
it can time out, especially when TSAN is enabled.

This adds functionality to our ADD_KUDU_TEST() cmake function to specify
a timeout and plumbs that timeout through to our test wrapper shell
script.

Tested by verifying that the appropriate environment variable gets set
in the environment of the running test.

Change-Id: I07661415d3500dfa5d7984b720b7a6f14597cc19
Reviewed-on: http://gerrit.cloudera.org:8080/7814
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Todd Lipcon <to...@apache.org>


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

Branch: refs/heads/master
Commit: c77d70f3e88973aa82f06ec97cb2b19b6507b3af
Parents: 3d42a26
Author: Todd Lipcon <to...@apache.org>
Authored: Thu Aug 24 14:21:16 2017 -0700
Committer: Todd Lipcon <to...@apache.org>
Committed: Fri Aug 25 03:37:26 2017 +0000

----------------------------------------------------------------------
 CMakeLists.txt                            | 45 ++++++++++++++++++++++++--
 build-support/run-test.sh                 |  3 ++
 src/kudu/integration-tests/CMakeLists.txt |  2 +-
 3 files changed, 46 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/c77d70f3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c3065c..6614987 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -651,8 +651,33 @@ endfunction()
 # net/net_util-test). Either way, the last component must be a globally
 # unique name.
 #
-# Arguments after the test name will be passed to set_tests_properties().
+# Additional optional arguments:
+#
+#   TIMEOUT <secs>
+#       Sets a timeout for running this test.
+#
+#       NOTE: this only affects the test timeout when run via 'ctest'.
+#       Jenkins builds typically execute tests using dist-test, and that
+#       does not respect these timeouts. If a test suite is long enough
+#       to require a bumped timeout, consider enabling sharding of the
+#       test by adding it to the NUM_SHARDS_BY_TEST dictionary in dist_test.py.
+#
+# Any other arguments will be passed to set_tests_properties().
 function(ADD_KUDU_TEST REL_TEST_NAME)
+  # Parse out properties for which we have special handling.
+  set(options)
+  set(one_value_args TIMEOUT)
+  set(multi_value_args)
+  cmake_parse_arguments(ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
+  if(NOT ARG_TIMEOUT)
+    # Default to 15 minutes.
+    # NOTE: this should be kept in sync with the default value of KUDU_TEST_TIMEOUT
+    # in build-support/run-test.sh
+    set(ARG_TIMEOUT 900)
+  endif()
+  # Any unrecognized arguments go into ${ARG_UNPARSED_ARGUMENTS}, which we forward
+  # along as properties down below.
+
   if(NO_TESTS)
     return()
   endif()
@@ -679,9 +704,23 @@ function(ADD_KUDU_TEST REL_TEST_NAME)
 
   add_test(${TEST_NAME}
     ${BUILD_SUPPORT_DIR}/run-test.sh ${TEST_PATH})
-  if(ARGN)
-    set_tests_properties(${TEST_NAME} PROPERTIES ${ARGN})
+  if(ARG_UNPARSED_ARGUMENTS)
+    set_tests_properties(${TEST_NAME} PROPERTIES ${ARG_UNPARSED_ARGUMENTS})
+  endif()
+  # Set the ctest timeout to be a bit longer than the timeout we pass to
+  # our test wrapper. This gives the test wrapper some opportunity to do
+  # things like dump stacks, compress the log, etc.
+  math(EXPR EXTENDED_TIMEOUT "${ARG_TIMEOUT} + 30")
+
+  # Add the configured timeout to the environment for the test wrapper.
+  get_test_property(${TEST_NAME} ENVIRONMENT CUR_TEST_ENV)
+  if(NOT CUR_TEST_ENV)
+    set(CUR_TEST_ENV "")
   endif()
+  list(APPEND CUR_TEST_ENV "KUDU_TEST_TIMEOUT=${ARG_TIMEOUT}")
+  set_tests_properties(${TEST_NAME} PROPERTIES
+    TIMEOUT ${EXTENDED_TIMEOUT}
+    ENVIRONMENT "${CUR_TEST_ENV}")
 endfunction()
 
 # A wrapper for add_dependencies() that is compatible with NO_TESTS.

http://git-wip-us.apache.org/repos/asf/kudu/blob/c77d70f3/build-support/run-test.sh
----------------------------------------------------------------------
diff --git a/build-support/run-test.sh b/build-support/run-test.sh
index 78910d5..941912b 100755
--- a/build-support/run-test.sh
+++ b/build-support/run-test.sh
@@ -114,6 +114,9 @@ export LSAN_OPTIONS
 # Set a 15-minute timeout for tests run via 'make test'.
 # This keeps our jenkins builds from hanging in the case that there's
 # a deadlock or anything.
+#
+# NOTE: this should be kept in sync with the default value of ARG_TIMEOUT
+# in the definition of ADD_KUDU_TEST in the top-level CMakeLists.txt.
 KUDU_TEST_TIMEOUT=${KUDU_TEST_TIMEOUT:-900}
 
 # Allow for collecting core dumps.

http://git-wip-us.apache.org/repos/asf/kudu/blob/c77d70f3/src/kudu/integration-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/CMakeLists.txt b/src/kudu/integration-tests/CMakeLists.txt
index 57c3f6c..495770e 100644
--- a/src/kudu/integration-tests/CMakeLists.txt
+++ b/src/kudu/integration-tests/CMakeLists.txt
@@ -72,7 +72,7 @@ ADD_KUDU_TEST(disk_failure-itest)
 ADD_KUDU_TEST(disk_reservation-itest)
 ADD_KUDU_TEST(exactly_once_writes-itest)
 ADD_KUDU_TEST(external_mini_cluster-test RESOURCE_LOCK "master-rpc-ports")
-ADD_KUDU_TEST(flex_partitioning-itest)
+ADD_KUDU_TEST(flex_partitioning-itest TIMEOUT 1800)
 ADD_KUDU_TEST(full_stack-insert-scan-test RUN_SERIAL true)
 ADD_KUDU_TEST(fuzz-itest RUN_SERIAL true)
 ADD_KUDU_TEST(linked_list-test RESOURCE_LOCK "master-rpc-ports")