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

Re: test failure

From
Lars Schneider <larsxschneider@gmail.com>
Date
Dec 17, 2016, 16:11 UTC
Message-ID
<B3D96792-047D-4C91-8DCC-60C800B2861B@gmail.com>
In-Reply-To
<50C75781-FE3B-410F-9866-63342607707B@gmail.com>
Show 45 quoted lines
> On 17 Dec 2016, at 15:28, Lars Schneider <larsxschneider@gmail.com> wrote:
> 
> 
>> On 16 Dec 2016, at 21:32, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
>> 
>> Hi Lars,
>> 
>> For the last two days, I've noticed t0021.15 on the 'pu' branch has been failing intermittently (well it fails with: 'make test >ptest-out', but
>> when run by hand, it fails only say 1-in-6, 1-in-18, etc.).
>> 
>> [yes, it's a bit strange; this hasn't changed in a couple of weeks!]
>> 
>> I don't have time to investigate further tonight and, since I had not
>> heard anyone else complain, I thought I should let you know.
>> 
>> See below for the output from a failing run. [Note: this is on Linux
>> Mint 18, tonight's pu branch @7c7984401].
> 
> Thanks Ramsay! 
> 
> I was able to reproduce the problem with this test:
> 
> 	test_expect_success 'ramsay-report' '
> 		test_config_global filter.protocol.clean cat &&
> 		git init &&
> 		echo "*.r filter=protocol" >.gitattributes &&
> 		echo "bla" >test.r &&
> 		git add . &&
> 		GIT_TRACE=1 git commit -m "test commit 2" > trace 2>&1 &&
> 		grep "run_command" trace
> 	'
> 
> It looks like as if Git occasionally forgets to run the clean filter.
> I bisected the problem and I think the problem starts with "diff: do not 
> reuse worktree files that need "clean" conversion" (06dec439a3) which
> definitively sounds related.
> 
> Back in June I reported that Git invokes the clean process 4 times if a
> single file is added. Peff took a closer look and suggested the patch
> mentioned above to remove one unnecessary invocation. I re-read his comments
> and everything sounds still reasonable to me:
> http://public-inbox.org/git/1469134747-26785-1-git-send-email-larsxschneider@gmail.com/#t
> 
> Does anyone have a clue what is going on? 
> I keep digging...

Ugh. I stopped coding, started cleaning the house, and it hit me: "git commit" shouldn't call the filter anyways. I suspect it is called in my tests because I add and commit the file to the index right after its creation. All this usually happens within 1 second and therefore Git cannot know if the file was modified between "add" and "commit". That's why it needs to run "clean" again.

I will adjust the tests.

Cheers, Lars

Previous: Lars SchneiderNext: larsxschneider@gmail.com
Message 3 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.