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

Re: [PATCH v1] t0021: fix flaky test

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Dec 19, 2016, 17:24 UTC
Message-ID
<6e0ea8b0-181a-2ab6-5bab-4f8dfa1d76fa@ramsayjones.plus.com>
In-Reply-To
<20161218123748.72101-1-larsxschneider@gmail.com>
On 18/12/16 12:37, larsxschneider@gmail.com wrote:
Show 51 quoted lines
> From: Lars Schneider <larsxschneider@gmail.com>
> 
> t0021.15 creates files, adds them to the index, and commits them. All
> this usually happens in a test run within the same second and Git cannot
> know if the files have been changed between `add` and `commit`.  Thus,
> Git has to run the clean filter in both operations. Sometimes these
> invocations spread over two different seconds and Git can infer that the
> files were not changed between `add` and `commit` based on their
> modification timestamp. The test would fail as it expects the filter
> invocation. Remove this expectation to make the test stable.
> 
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
> 
> Notes:
>     Base Commit: f8bf8f2a7b (next)
>     Diff on Web: https://github.com/git/git/compare/f8bf8f2a7b...larsxschneider:9d88b66e03
>     Checkout:    git fetch https://github.com/larsxschneider/git filter-process/fix-flaky-test-v1 && git checkout 9d88b66e03
> 
>  t/t0021-conversion.sh | 17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
> index 6f16983d3e..161f560446 100755
> --- a/t/t0021-conversion.sh
> +++ b/t/t0021-conversion.sh
> @@ -377,22 +377,7 @@ test_expect_success PERL 'required process filter should filter data' '
>  		EOF
>  		test_cmp_count expected.log rot13-filter.log &&
>  
> -		filter_git commit -m "test commit 2" &&
> -		cat >expected.log <<-EOF &&
> -			START
> -			init handshake complete
> -			IN: clean test.r $S [OK] -- OUT: $S . [OK]
> -			IN: clean test2.r $S2 [OK] -- OUT: $S2 . [OK]
> -			IN: clean test4-empty.r 0 [OK] -- OUT: 0  [OK]
> -			IN: clean testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
> -			IN: clean test.r $S [OK] -- OUT: $S . [OK]
> -			IN: clean test2.r $S2 [OK] -- OUT: $S2 . [OK]
> -			IN: clean test4-empty.r 0 [OK] -- OUT: 0  [OK]
> -			IN: clean testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
> -			STOP
> -		EOF
> -		test_cmp_count expected.log rot13-filter.log &&
> -
> +		git commit -m "test commit 2" &&
>  		rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" &&
>  
>  		filter_git checkout --quiet --no-progress . &&
> 

I applied this to the pu branch and ran the test by hand 48 times in a row without failure. (the most trials without error beforehand was 24).

Thanks.

ATB, Ramsay Jones

Previous: larsxschneider@gmail.comNext: Jeff King
Message 5 of 6 in “test failure”
  1. Ramsay JonesDec 16, 2016
  2. Lars SchneiderDec 17, 2016
  3. Lars SchneiderDec 17, 2016
  4. t0021: fix flaky testlarsxschneider@gmail.com, Dec 18, 2016
  5. Ramsay JonesDec 19, 2016
  6. Jeff KingDec 19, 2016

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.