From: Junio C Hamano Date: Wed, 20 Mar 2019 06:16:05 +0000 (+0900) Subject: Merge branch 'js/stress-test-ui-tweak' X-Git-Tag: v2.22.0-rc0~141 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/88255bba4518c02d8eb9678d7358175158a1d7cb?ds=sidebyside;hp=-c Merge branch 'js/stress-test-ui-tweak' Dev support. * js/stress-test-ui-tweak: tests: introduce --stress-jobs= tests: let --stress-limit= imply --stress --- 88255bba4518c02d8eb9678d7358175158a1d7cb diff --combined t/README index 7a3d582267,bd6d22ecc5..656288edce --- a/t/README +++ b/t/README @@@ -196,11 -196,10 +196,10 @@@ appropriately before running "make" variable to "1" or "0", respectively. --stress:: - --stress=:: Run the test script repeatedly in multiple parallel jobs until one of them fails. Useful for reproducing rare failures in flaky tests. The number of parallel jobs is, in order of - precedence: , or the value of the GIT_TEST_STRESS_LOAD + precedence: the value of the GIT_TEST_STRESS_LOAD environment variable, or twice the number of available processors (as shown by the 'getconf' utility), or 8. Implies `--verbose -x --immediate` to get the most information @@@ -211,10 -210,13 +210,13 @@@ '.stress-' suffix, and the trash directory of the failed test job is renamed to end with a '.stress-failed' suffix. + --stress-jobs=:: + Override the number of parallel jobs. Implies `--stress`. + --stress-limit=:: When combined with --stress run the test script repeatedly this many times in each of the parallel jobs or until one of - them fails, whichever comes first. + them fails, whichever comes first. Implies `--stress`. You can also set the GIT_TEST_INSTALLED environment variable to the bindir of an existing git installation to test that installation. @@@ -932,15 -934,6 +934,15 @@@ library for your script to use test_oid_init or test_oid_cache. Providing an unknown key is an error. + - yes [] + + This is often seen in modern UNIX but some platforms lack it, so + the test harness overrides the platform implementation with a + more limited one. Use this only when feeding a handful lines of + output to the downstream---unlike the real version, it generates + only up to 99 lines. + + Prerequisites ------------- diff --combined t/test-lib.sh index 4e79e140c9,66099a4804..562c57e685 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -147,10 -147,16 +147,16 @@@ d --stress) stress=t ;; --stress=*) + echo "error: --stress does not accept an argument: '$opt'" >&2 + echo "did you mean --stress-jobs=${opt#*=} or --stress-limit=${opt#*=}?" >&2 + exit 1 + ;; + --stress-jobs=*) + stress=t; stress=${opt#--*=} case "$stress" in *[!0-9]*|0*|"") - echo "error: --stress= requires the number of jobs to run" >&2 + echo "error: --stress-jobs= requires the number of jobs to run" >&2 exit 1 ;; *) # Good. @@@ -158,6 -164,7 +164,7 @@@ esac ;; --stress-limit=*) + stress=t; stress_limit=${opt#--*=} case "$stress_limit" in *[!0-9]*|0*|"") @@@ -1327,11 -1334,7 +1334,11 @@@ the fi fi -# Provide an implementation of the 'yes' utility +# Provide an implementation of the 'yes' utility; the upper bound +# limit is there to help Windows that cannot stop this loop from +# wasting cycles when the downstream stops reading, so do not be +# tempted to turn it into an infinite loop. cf. 6129c930 ("test-lib: +# limit the output of the yes utility", 2016-02-02) yes () { if test $# = 0 then