summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-03-03 14:44:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-04 03:25:22 (GMT)
commitf54573714429ce249bab7422a51f3a8c37016080 (patch)
tree963308b1e51c92e28483ce8230978f236f912554 /t
parentde69e6f6c98e92f89b4fdbb91087e85f4af7afab (diff)
downloadgit-f54573714429ce249bab7422a51f3a8c37016080.zip
git-f54573714429ce249bab7422a51f3a8c37016080.tar.gz
git-f54573714429ce249bab7422a51f3a8c37016080.tar.bz2
tests: introduce --stress-jobs=<N>
The --stress option currently accepts an argument, but it is confusing to at least this user that the argument does not define the maximal number of stress iterations, but instead the number of jobs to run in parallel per stress iteration. Let's introduce a separate option for that, whose name makes it more obvious what it is about, and let --stress=<N> error out with a helpful suggestion about the two options tha could possibly have been meant. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/README6
-rw-r--r--t/test-lib.sh8
2 files changed, 11 insertions, 3 deletions
diff --git a/t/README b/t/README
index 48fd400..bd6d22e 100644
--- a/t/README
+++ b/t/README
@@ -196,11 +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
@@ -211,6 +210,9 @@ appropriately before running "make".
'.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
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 8553c1f..66099a4 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -147,10 +147,16 @@ do
--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.