diff options
| author | 2017-03-16 08:17:24 +0000 | |
|---|---|---|
| committer | 2017-03-16 08:17:25 +0000 | |
| commit | ec024ad3b40d007dda99fb43d498312ddbd4e2f6 (patch) | |
| tree | c1b8e002e0a5e0e6d792fff112ab33b9bbed0e62 | |
| parent | 998e42aac59a55585603365367f4351f6d4344b1 (diff) | |
| parent | 020c0f36deeded5155fe0cd73ef65e4bfd3e8e04 (diff) | |
Merge "Cleanup use of ulimit in run tests."
| -rw-r--r-- | test/701-easy-div-rem/build | 8 | ||||
| -rwxr-xr-x | test/961-default-iface-resolution-gen/build | 12 | ||||
| -rwxr-xr-x | test/964-default-iface-init-gen/build | 12 | ||||
| -rwxr-xr-x | test/968-default-partial-compile-gen/build | 12 | ||||
| -rwxr-xr-x | test/970-iface-super-resolution-gen/build | 12 | ||||
| -rwxr-xr-x | test/971-iface-super/build | 12 | ||||
| -rwxr-xr-x | test/etc/run-test-jar | 18 | ||||
| -rwxr-xr-x | test/run-test | 41 |
8 files changed, 9 insertions, 118 deletions
diff --git a/test/701-easy-div-rem/build b/test/701-easy-div-rem/build index 666fe895b5..d83ee82b47 100644 --- a/test/701-easy-div-rem/build +++ b/test/701-easy-div-rem/build @@ -21,12 +21,4 @@ set -e mkdir src python ./genMain.py -# Increase the file size limitation for classes.lst as the machine generated -# source file contains a lot of methods and is quite large. - -# Jack generates big temp files so only apply ulimit for dx. -if [ ${USE_JACK} = "false" ]; then - ulimit -S 4096 -fi - ./default-build diff --git a/test/961-default-iface-resolution-gen/build b/test/961-default-iface-resolution-gen/build index ccebbe4ac9..2f7e3ba553 100755 --- a/test/961-default-iface-resolution-gen/build +++ b/test/961-default-iface-resolution-gen/build @@ -17,15 +17,6 @@ # make us exit on a failure set -e -# We will be making more files than the ulimit is set to allow. Remove it temporarily. -OLD_ULIMIT=`ulimit -S` -ulimit -S unlimited - -restore_ulimit() { - ulimit -S "$OLD_ULIMIT" -} -trap 'restore_ulimit' ERR - if [[ $@ != *"--jvm"* ]]; then # Don't do anything with jvm # Hard-wired use of experimental jack. @@ -39,6 +30,3 @@ mkdir -p ./src ./util-src/generate_java.py ./src ./expected.txt ./default-build "$@" --experimental default-methods - -# Reset the ulimit back to its initial value -restore_ulimit diff --git a/test/964-default-iface-init-gen/build b/test/964-default-iface-init-gen/build index ccebbe4ac9..2f7e3ba553 100755 --- a/test/964-default-iface-init-gen/build +++ b/test/964-default-iface-init-gen/build @@ -17,15 +17,6 @@ # make us exit on a failure set -e -# We will be making more files than the ulimit is set to allow. Remove it temporarily. -OLD_ULIMIT=`ulimit -S` -ulimit -S unlimited - -restore_ulimit() { - ulimit -S "$OLD_ULIMIT" -} -trap 'restore_ulimit' ERR - if [[ $@ != *"--jvm"* ]]; then # Don't do anything with jvm # Hard-wired use of experimental jack. @@ -39,6 +30,3 @@ mkdir -p ./src ./util-src/generate_java.py ./src ./expected.txt ./default-build "$@" --experimental default-methods - -# Reset the ulimit back to its initial value -restore_ulimit diff --git a/test/968-default-partial-compile-gen/build b/test/968-default-partial-compile-gen/build index 1e9f8aadd5..00ccb89faf 100755 --- a/test/968-default-partial-compile-gen/build +++ b/test/968-default-partial-compile-gen/build @@ -17,15 +17,6 @@ # make us exit on a failure set -e -# We will be making more files than the ulimit is set to allow. Remove it temporarily. -OLD_ULIMIT=`ulimit -S` -ulimit -S unlimited - -restore_ulimit() { - ulimit -S "$OLD_ULIMIT" -} -trap 'restore_ulimit' ERR - # TODO: Support running with jack. if [[ $@ == *"--jvm"* ]]; then @@ -45,6 +36,3 @@ else # Use the default build script ./default-build "$@" "$EXTRA_ARGS" --experimental default-methods fi - -# Reset the ulimit back to its initial value -restore_ulimit diff --git a/test/970-iface-super-resolution-gen/build b/test/970-iface-super-resolution-gen/build index fd1b271c1c..7217fac601 100755 --- a/test/970-iface-super-resolution-gen/build +++ b/test/970-iface-super-resolution-gen/build @@ -17,15 +17,6 @@ # make us exit on a failure set -e -# We will be making more files than the ulimit is set to allow. Remove it temporarily. -OLD_ULIMIT=`ulimit -S` -ulimit -S unlimited - -restore_ulimit() { - ulimit -S "$OLD_ULIMIT" -} -trap 'restore_ulimit' ERR - # Should we compile with Java source code. By default we will use Smali. USES_JAVA_SOURCE="false" if [[ $@ == *"--jvm"* ]]; then @@ -50,6 +41,3 @@ else fi ./default-build "$@" --experimental default-methods - -# Reset the ulimit back to its initial value -restore_ulimit diff --git a/test/971-iface-super/build b/test/971-iface-super/build index 1e9f8aadd5..00ccb89faf 100755 --- a/test/971-iface-super/build +++ b/test/971-iface-super/build @@ -17,15 +17,6 @@ # make us exit on a failure set -e -# We will be making more files than the ulimit is set to allow. Remove it temporarily. -OLD_ULIMIT=`ulimit -S` -ulimit -S unlimited - -restore_ulimit() { - ulimit -S "$OLD_ULIMIT" -} -trap 'restore_ulimit' ERR - # TODO: Support running with jack. if [[ $@ == *"--jvm"* ]]; then @@ -45,6 +36,3 @@ else # Use the default build script ./default-build "$@" "$EXTRA_ARGS" --experimental default-methods fi - -# Reset the ulimit back to its initial value -restore_ulimit diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index e4e571cbcf..808e58a7bd 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -444,27 +444,11 @@ fi JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni" +COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xnorelocate" if [ "$RELOCATE" = "y" ]; then - COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xnorelocate" FLAGS="${FLAGS} -Xrelocate" - if [ "$HOST" = "y" ]; then - # Run test sets a fairly draconian ulimit that we will likely blow right over - # since we are relocating. Get the total size of the /system/framework directory - # in 512 byte blocks and set it as the ulimit. This should be more than enough - # room. - if [ ! `uname` = "Darwin" ]; then # TODO: Darwin doesn't support "du -B..." - ulimit -S $(du -c -B512 ${ANDROID_HOST_OUT}/framework 2>/dev/null | tail -1 | cut -f1) || exit 1 - fi - fi else FLAGS="$FLAGS -Xnorelocate" - COMPILE_FLAGS="${COMPILE_FLAGS} --runtime-arg -Xnorelocate" -fi - -if [ "$HOST" = "y" ]; then - # Increase ulimit to 128MB in case we are running hprof test, - # or string append test with art-debug-gc. - ulimit -S 128000 || exit 1 fi if [ "$HOST" = "n" ]; then diff --git a/test/run-test b/test/run-test index 1ac285769d..1715423a5c 100755 --- a/test/run-test +++ b/test/run-test @@ -766,27 +766,14 @@ fi run_args="${run_args} --testlib ${testlib}" -# To cause tests to fail fast, limit the file sizes created by dx, dex2oat and ART output to 2MB. -build_file_size_limit=2048 -run_file_size_limit=2048 - -# Add tests requiring a higher ulimit to this list. Ulimits might need to be raised to deal with -# large amounts of expected output or large generated files. -if echo "$test_dir" | grep -Eq "(083|089|961|964|971)" > /dev/null; then - build_file_size_limit=5120 - run_file_size_limit=5120 -fi -if [ "$run_checker" = "yes" -a "$target_mode" = "yes" ]; then - # We will need to `adb pull` the .cfg output from the target onto the host to - # run checker on it. This file can be big. - build_file_size_limit=32768 - run_file_size_limit=32768 -fi -if [ ${USE_JACK} = "false" ]; then - # Set ulimit if we build with dx only, Jack can generate big temp files. - if ! ulimit -S "$build_file_size_limit"; then - err_echo "ulimit file size setting failed" - fi +# To cause tests to fail fast, limit the file sizes created by dx, dex2oat and +# ART output to approximately 128MB. This should be more than sufficient +# for any test while still catching cases of runaway output. +# Set a hard limit to encourage ART developers to increase the ulimit here if +# needed to support a test case rather than resetting the limit in the run +# script for the particular test in question. +if ! ulimit -f -H 128000; then + err_echo "ulimit file size setting failed" fi good="no" @@ -797,9 +784,6 @@ if [ "$dev_mode" = "yes" ]; then build_exit="$?" echo "build exit status: $build_exit" 1>&2 if [ "$build_exit" = '0' ]; then - if ! ulimit -S "$run_file_size_limit"; then - err_echo "ulimit file size setting failed" - fi echo "${test_dir}: running..." 1>&2 "./${run}" $run_args "$@" 2>&1 run_exit="$?" @@ -825,9 +809,6 @@ elif [ "$update_mode" = "yes" ]; then "./${build}" $build_args >"$build_output" 2>&1 build_exit="$?" if [ "$build_exit" = '0' ]; then - if ! ulimit -S "$run_file_size_limit"; then - err_echo "ulimit file size setting failed" - fi echo "${test_dir}: running..." 1>&2 "./${run}" $run_args "$@" >"$output" 2>&1 if [ "$run_checker" = "yes" ]; then @@ -862,9 +843,6 @@ else "./${build}" $build_args >"$build_output" 2>&1 build_exit="$?" if [ "$build_exit" = '0' ]; then - if ! ulimit -S "$run_file_size_limit"; then - err_echo "ulimit file size setting failed" - fi echo "${test_dir}: running..." 1>&2 "./${run}" $run_args "$@" >"$output" 2>&1 run_exit="$?" @@ -934,9 +912,6 @@ if [ "$bisection_search" = "yes" -a "$good" != "yes" ]; then echo "${test_dir}: not bisecting, checker test." 1>&2 else # Increase file size limit, bisection search can generate large logfiles. - if ! ulimit -S unlimited; then - err_echo "ulimit file size setting failed" - fi echo "${test_dir}: bisecting..." 1>&2 cwd=`pwd` maybe_device_mode="" |