aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-03-20 15:16:05 +0900
committerJunio C Hamano <gitster@pobox.com>2019-03-20 15:16:05 +0900
commit88255bba4518c02d8eb9678d7358175158a1d7cb (patch)
treec995b1192b2efcd07c38405fc31b0f383435406b
parentMerge branch 'js/rebase-orig-head-fix' (diff)
parenttests: introduce --stress-jobs=<N> (diff)
downloadgit-88255bba4518c02d8eb9678d7358175158a1d7cb.tar.xz
git-88255bba4518c02d8eb9678d7358175158a1d7cb.zip
Merge branch 'js/stress-test-ui-tweak'
Dev support. * js/stress-test-ui-tweak: tests: introduce --stress-jobs=<N> tests: let --stress-limit=<N> imply --stress
-rw-r--r--t/README8
-rw-r--r--t/test-lib.sh9
2 files changed, 13 insertions, 4 deletions
diff --git a/t/README b/t/README
index 7a3d582267c..656288edcea 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,10 +210,13 @@ 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
- 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.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4e79e140c90..562c57e6858 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.
@@ -158,6 +164,7 @@ do
esac
;;
--stress-limit=*)
+ stress=t;
stress_limit=${opt#--*=}
case "$stress_limit" in
*[!0-9]*|0*|"")