Re: [PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-24 Thread Adam Spiers
On Mon, Apr 22, 2013 at 11:03:44AM -0700, Junio C Hamano wrote: Adam Spiers g...@adamspiers.org writes: On Thu, Apr 11, 2013 at 03:11:32PM -0400, Jeff King wrote: I always get a little nervous with sleeps in the test suite, as they are indicative that we are trying to avoid some race

Re: [PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-22 Thread Junio C Hamano
Adam Spiers g...@adamspiers.org writes: On Thu, Apr 11, 2013 at 03:11:32PM -0400, Jeff King wrote: I always get a little nervous with sleeps in the test suite, as they are indicative that we are trying to avoid some race condition, which means that the test can fail when the system is under

[PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-11 Thread Adam Spiers
Some callers, such as the git-annex web assistant, find it useful to invoke git check-ignore as a persistent background process, which can then have queries fed to its STDIN at any point, and the corresponding response consumed from its STDOUT. For this we need to invoke check_ignore() once per

Re: [PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-11 Thread Jeff King
On Thu, Apr 11, 2013 at 01:05:12PM +0100, Adam Spiers wrote: +test_expect_success 'setup: have stdbuf?' ' + if which stdbuf /dev/null 21 + then + test_set_prereq STDBUF + fi +' + +test_expect_success STDBUF 'streaming support for --stdin' ' + ( +

Re: [PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-11 Thread Adam Spiers
On Thu, Apr 11, 2013 at 03:11:32PM -0400, Jeff King wrote: I always get a little nervous with sleeps in the test suite, as they are indicative that we are trying to avoid some race condition, which means that the test can fail when the system is under load, or when a tool like valgrind is used

Re: [PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-11 Thread Jeff King
On Thu, Apr 11, 2013 at 09:31:41PM +0100, Adam Spiers wrote: The shell source is strong with this one ;-) Congrats - I first tried with FIFOs (hence my other patch which moves the PIPE test prerequisite definition into the core framework - the original intention was to reuse it here) but

Re: [PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-11 Thread Aaron Schrab
At 13:05 +0100 11 Apr 2013, Adam Spiers g...@adamspiers.org wrote: The above use case suggests that empty STDIN is actually a reasonable scenario (e.g. when the caller doesn't know in advance whether any queries need to be fed to the background process until after it's already started), so we

Re: [PATCH v2 4/5] check-ignore: allow incremental streaming of queries via --stdin

2013-04-11 Thread Adam Spiers
On Thu, Apr 11, 2013 at 05:04:30PM -0400, Aaron Schrab wrote: At 13:05 +0100 11 Apr 2013, Adam Spiers g...@adamspiers.org wrote: The above use case suggests that empty STDIN is actually a reasonable scenario (e.g. when the caller doesn't know in advance whether any queries need to be fed to