]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/stress-test-ui-tweak'
authorJunio C Hamano <gitster@pobox.com>
Wed, 20 Mar 2019 06:16:05 +0000 (15:16 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Mar 2019 06:16:05 +0000 (15:16 +0900)
Dev support.

* js/stress-test-ui-tweak:
  tests: introduce --stress-jobs=<N>
  tests: let --stress-limit=<N> imply --stress

1  2 
t/README
t/test-lib.sh

diff --combined t/README
index 7a3d582267c7f8f70f018d95dbed4d085ed89f98,bd6d22ecc5c9339d589d05ecf86cb392688025d6..656288edcea5a23a5893ade5c2d81ee429eb26e8
+++ b/t/README
@@@ -196,11 -196,10 +196,10 @@@ appropriately before running "make"
        variable to "1" or "0", respectively.
  
  --stress::
- --stress=<N>::
        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: <N>, 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
        '.stress-<nr>' suffix, and the trash directory of the failed
        test job is renamed to end with a '.stress-failed' suffix.
  
+ --stress-jobs=<N>::
+       Override the number of parallel jobs. Implies `--stress`.
  --stress-limit=<N>::
        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 [<string>]
 +
 +   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 4e79e140c90ba5aa8cdbe7daeafba45765cecd8e,66099a48044b57dd0740999b26210fc3058ba8f7..562c57e6858b79aff074fcb7ab8c65fa2f110bc0
        --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=<N> requires the number of jobs to run" >&2
+                       echo "error: --stress-jobs=<N> requires the number of jobs to run" >&2
                        exit 1
                        ;;
                *)      # Good.
                esac
                ;;
        --stress-limit=*)
+               stress=t;
                stress_limit=${opt#--*=}
                case "$stress_limit" in
                *[!0-9]*|0*|"")
        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