From de69e6f6c98e92f89b4fdbb91087e85f4af7afab Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 3 Mar 2019 06:44:54 -0800 Subject: tests: let --stress-limit= imply --stress It does not make much sense that running a test with --stress-limit= seemingly ignores that option because it does not stress test at all. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/README | 2 +- t/test-lib.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/README b/t/README index 886bbec5bc..48fd4009e1 100644 --- a/t/README +++ b/t/README @@ -214,7 +214,7 @@ appropriately before running "make". --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. diff --git a/t/test-lib.sh b/t/test-lib.sh index 8665b0a9b6..8553c1ff87 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -158,6 +158,7 @@ do esac ;; --stress-limit=*) + stress=t; stress_limit=${opt#--*=} case "$stress_limit" in *[!0-9]*|0*|"") -- cgit v1.2.3 From f54573714429ce249bab7422a51f3a8c37016080 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 3 Mar 2019 06:44:55 -0800 Subject: tests: introduce --stress-jobs= 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= error out with a helpful suggestion about the two options tha could possibly have been meant. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/README | 6 ++++-- t/test-lib.sh | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/README b/t/README index 48fd4009e1..bd6d22ecc5 100644 --- a/t/README +++ b/t/README @@ -196,11 +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,6 +210,9 @@ appropriately before running "make". '.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 diff --git a/t/test-lib.sh b/t/test-lib.sh index 8553c1ff87..66099a4804 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= requires the number of jobs to run" >&2 + echo "error: --stress-jobs= requires the number of jobs to run" >&2 exit 1 ;; *) # Good. -- cgit v1.2.3