git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] tests: introduce --stress-jobs=<N>

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Mar 3, 2019, 14:19 UTC
Message-ID
<20190303141946.GA28939@szeder.dev>
In-Reply-To
<281d3f1d19d1c93e8d1e66ae16fe3fb286554c0a.1551561582.git.gitgitgadget@gmail.com>
On Sat, Mar 02, 2019 at 01:19:44PM -0800, Johannes Schindelin via GitGitGadget wrote:
> 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.

Well, these options' description in 't/README' is quite clear on what they do. If the lack of updates to 't/README' in these patches is any indication, then you haven't read that :) but doing so might very well have avoided your confusion in the first place.

According to my Bash history, I used '--stress=<even-more-cpu-cores>' about 20x more often than '--stress-limit=<N>'. That's not surprising at all, since the main point is to try to trigger rare, hard to reproduce failures, no matter how many repetitions it takes. And even if there is an upper bound, it is usually not the number of repetitions I know in advance, but rather the time I'm willing to sacrifice on it, e.g. how long I'm on lunch break or doing groceries, or when I need my CPUs for more important things, or simply when I give up, and hit ctrl-C.

And with --stress-jobs=<N> I will have to type more :)
Show 33 quoted lines
> 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>
> ---
>  t/test-lib.sh | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index ab7f27ec6a..6e557982a2 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -142,10 +142,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.
> -- 
> gitgitgadget
Previous: Junio C HamanoNext: Johannes Schindelin
Message 5 of 15 in “tests: some touchups related to the --stress feature”
  1. 0/2 tests: some touchups related to the --stress featureJohannes Schindelin via GitGitGadget, Mar 2, 2019
  2. 2/2 tests: introduce --stress-jobs=<N>Johannes Schindelin via GitGitGadget, Mar 2, 2019
  3. Eric SunshineMar 3, 2019
  4. Junio C HamanoMar 3, 2019
  5. SZEDER GáborMar 3, 2019
  6. Johannes SchindelinMar 3, 2019
  7. 1/2 tests: let --stress-limit=<N> imply --stressJohannes Schindelin via GitGitGadget, Mar 2, 2019
  8. Junio C HamanoMar 3, 2019
  9. 0/2 tests: some touchups related to the --stress featureJohannes Schindelin via GitGitGadget, Mar 3, 2019
  10. 1/2 tests: let --stress-limit=<N> imply --stressJohannes Schindelin via GitGitGadget, Mar 3, 2019
  11. 2/2 tests: introduce --stress-jobs=<N>Johannes Schindelin via GitGitGadget, Mar 3, 2019
  12. Eric SunshineMar 3, 2019
  13. Junio C HamanoMar 4, 2019
  14. Eric SunshineMar 4, 2019
  15. Jeff KingMar 3, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.