git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output
@ 2015-12-20 16:44 larsxschneider
  2015-12-20 16:44 ` [PATCH v1 1/2] git-p4: kill p4d watchdog on cleanup larsxschneider
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: larsxschneider @ 2015-12-20 16:44 UTC (permalink / raw)
  To: git; +Cc: luke, sunshine, Lars Schneider

From: Lars Schneider <larsxschneider@gmail.com>

Hi,

these patches extend "git-p4: add trap to kill p4d on test exit" (dfe90e8)
and therefore should be applied on master.

Thanks,
Lars

Lars Schneider (2):
  git-p4: kill p4d watchdog on cleanup
  git-p4: suppress non test relevant output

 t/lib-git-p4.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.5.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v1 1/2] git-p4: kill p4d watchdog on cleanup
  2015-12-20 16:44 [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output larsxschneider
@ 2015-12-20 16:44 ` larsxschneider
  2015-12-20 16:44 ` [PATCH v1 2/2] git-p4: suppress non test relevant output larsxschneider
  2015-12-21 20:31 ` [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output Junio C Hamano
  2 siblings, 0 replies; 8+ messages in thread
From: larsxschneider @ 2015-12-20 16:44 UTC (permalink / raw)
  To: git; +Cc: luke, sunshine, Lars Schneider

From: Lars Schneider <larsxschneider@gmail.com>

If failing tests are executed with the "immediate" flag then "kill_p4d"
is not called and consequently the watchdog process, which is supposed
to detect a hanging p4d, is not killed. Kill the watchdog always in the
"on exit" cleanup trap.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 t/lib-git-p4.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
index f9ae1d7..30bf7ae 100644
--- a/t/lib-git-p4.sh
+++ b/t/lib-git-p4.sh
@@ -76,6 +76,7 @@ pidfile="$TRASH_DIRECTORY/p4d.pid"

 # Sometimes "prove" seems to hang on exit because p4d is still running
 cleanup() {
+	kill -9 $watchdog_pid 2>/dev/null
 	if test -f "$pidfile"
 	then
 		kill -9 $(cat "$pidfile") 2>/dev/null && exit 255
--
2.5.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v1 2/2] git-p4: suppress non test relevant output
  2015-12-20 16:44 [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output larsxschneider
  2015-12-20 16:44 ` [PATCH v1 1/2] git-p4: kill p4d watchdog on cleanup larsxschneider
@ 2015-12-20 16:44 ` larsxschneider
  2015-12-21 20:38   ` Junio C Hamano
  2015-12-21 20:31 ` [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output Junio C Hamano
  2 siblings, 1 reply; 8+ messages in thread
From: larsxschneider @ 2015-12-20 16:44 UTC (permalink / raw)
  To: git; +Cc: luke, sunshine, Lars Schneider

From: Lars Schneider <larsxschneider@gmail.com>

If tests are executed in verbose mode then the retry logic clutters the
test output. Suppress that clutter.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 t/lib-git-p4.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
index 30bf7ae..03f29c1 100644
--- a/t/lib-git-p4.sh
+++ b/t/lib-git-p4.sh
@@ -174,7 +174,7 @@ retry_until_fail() {
 	until ! "$@" 2>/dev/null || test $(time_in_seconds) -gt $timeout
 	do
 		sleep 1
-	done
+	done >/dev/null 2>&1
 }

 kill_p4d() {
--
2.5.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output
  2015-12-20 16:44 [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output larsxschneider
  2015-12-20 16:44 ` [PATCH v1 1/2] git-p4: kill p4d watchdog on cleanup larsxschneider
  2015-12-20 16:44 ` [PATCH v1 2/2] git-p4: suppress non test relevant output larsxschneider
@ 2015-12-21 20:31 ` Junio C Hamano
  2015-12-22  9:12   ` Lars Schneider
  2 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2015-12-21 20:31 UTC (permalink / raw)
  To: larsxschneider; +Cc: git, luke, sunshine

larsxschneider@gmail.com writes:

> From: Lars Schneider <larsxschneider@gmail.com>
>
> Hi,
>
> these patches extend "git-p4: add trap to kill p4d on test exit" (dfe90e8)
> and therefore should be applied on master.

Wait, wait.  Please be a bit more careful when you use such a
phrasing.  Did somebody review these and said that these are
trivially correct improvements?

This depends on what you exactly meant "extend" and "improve" (for
the other one); if the "improvement" were to make something that
used to be unusable to usable, then the more sensible way forward
during the -rc stabilization period might be to revert the earlier
merges to 'master' that brought in undercooked topic.

Thanks.

>
> Thanks,
> Lars
>
> Lars Schneider (2):
>   git-p4: kill p4d watchdog on cleanup
>   git-p4: suppress non test relevant output
>
>  t/lib-git-p4.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> --
> 2.5.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 2/2] git-p4: suppress non test relevant output
  2015-12-20 16:44 ` [PATCH v1 2/2] git-p4: suppress non test relevant output larsxschneider
@ 2015-12-21 20:38   ` Junio C Hamano
  2015-12-22  8:47     ` Lars Schneider
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2015-12-21 20:38 UTC (permalink / raw)
  To: larsxschneider; +Cc: git, luke, sunshine

larsxschneider@gmail.com writes:

> From: Lars Schneider <larsxschneider@gmail.com>
>
> If tests are executed in verbose mode then the retry logic clutters the
> test output. Suppress that clutter.
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
>  t/lib-git-p4.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
> index 30bf7ae..03f29c1 100644
> --- a/t/lib-git-p4.sh
> +++ b/t/lib-git-p4.sh
> @@ -174,7 +174,7 @@ retry_until_fail() {
>  	until ! "$@" 2>/dev/null || test $(time_in_seconds) -gt $timeout
>  	do
>  		sleep 1
> -	done
> +	done >/dev/null 2>&1

Eh, what does this squelch?  The sleep in the body of the loop is
silent, "test A -gt B" on the loop condition would be silent too, so
you are squelching the invocation of "$@" whose standard error
stream is already sent to 2>/dev/null?

If so, why not do it there instead?  You seem to run only "kill" to
send some signal to a process using this helper function, and it
would be silent on its standard output stream (even though it may
say "no such process" etc. on its standard error), so it is not
clear to me what you are doing with this change here...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 2/2] git-p4: suppress non test relevant output
  2015-12-21 20:38   ` Junio C Hamano
@ 2015-12-22  8:47     ` Lars Schneider
  2015-12-24 11:09       ` Luke Diamand
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Schneider @ 2015-12-22  8:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, luke, sunshine


On 21 Dec 2015, at 21:38, Junio C Hamano <gitster@pobox.com> wrote:

> larsxschneider@gmail.com writes:
> 
>> From: Lars Schneider <larsxschneider@gmail.com>
>> 
>> If tests are executed in verbose mode then the retry logic clutters the
>> test output. Suppress that clutter.
>> 
>> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
>> ---
>> t/lib-git-p4.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
>> index 30bf7ae..03f29c1 100644
>> --- a/t/lib-git-p4.sh
>> +++ b/t/lib-git-p4.sh
>> @@ -174,7 +174,7 @@ retry_until_fail() {
>> 	until ! "$@" 2>/dev/null || test $(time_in_seconds) -gt $timeout
>> 	do
>> 		sleep 1
>> -	done
>> +	done >/dev/null 2>&1
> 
> Eh, what does this squelch?  The sleep in the body of the loop is
> silent, "test A -gt B" on the loop condition would be silent too, so
> you are squelching the invocation of "$@" whose standard error
> stream is already sent to 2>/dev/null?
> 
> If so, why not do it there instead?  You seem to run only "kill" to
> send some signal to a process using this helper function, and it
> would be silent on its standard output stream (even though it may
> say "no such process" etc. on its standard error), so it is not
> clear to me what you are doing with this change here...

If I run git-p4 tests in verbose mode (e.g. "./t9823-git-p4-mock-lfs.sh -v") without this patch then the last lines of the output look like this:

>>> Output Start >>>
expecting success:
	kill_p4d

./lib-git-p4.sh: line 172: 26289 Killed: 9               while true; do
    if test $(time_in_seconds) -gt $timeout; then
        kill -9 $pid; exit 1;
    fi; sleep 1;
done
ok 8 - kill p4d

# passed all 8 test(s)
1..8 
<<< Output end <<<

However, I want them to look like this:

>>> Output Start >>>
expecting success:
	kill_p4d

ok 8 - kill p4d

# passed all 8 test(s)
1..8
<<< Output end <<<

This is achieved with the patch. I am no shell expert ... is there a nicer way to achieve the same?

Thanks,
Lars

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output
  2015-12-21 20:31 ` [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output Junio C Hamano
@ 2015-12-22  9:12   ` Lars Schneider
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Schneider @ 2015-12-22  9:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, luke, sunshine


On 21 Dec 2015, at 21:31, Junio C Hamano <gitster@pobox.com> wrote:

> larsxschneider@gmail.com writes:
> 
>> From: Lars Schneider <larsxschneider@gmail.com>
>> 
>> Hi,
>> 
>> these patches extend "git-p4: add trap to kill p4d on test exit" (dfe90e8)
>> and therefore should be applied on master.
> 
> Wait, wait.  Please be a bit more careful when you use such a
> phrasing.  Did somebody review these and said that these are
> trivially correct improvements?
> 
> This depends on what you exactly meant "extend" and "improve" (for
> the other one); if the "improvement" were to make something that
> used to be unusable to usable, then the more sensible way forward
> during the -rc stabilization period might be to revert the earlier
> merges to 'master' that brought in undercooked topic.

Oh. Thanks or making me aware of the inappropriate phrases! 
Nobody reviewed these patches, yet! 

My intention was to let the reviewer know that this patch series is based on 
"master" and not on "maint". Sorry for the confusion!

The patch series "git-p4: kill watchdog and suppress irrelevant output" fixes
something annoying that I did not spot earlier. In other words it changes
"usable but a bit annoying (dfe90e8)" to "usable".

The patch series "git-p4: ignore P4 changelists that only touch files" changes 
"usable (4ae048e)" to "maybe even better" depending on the reviewers
opinion.

Thanks,
Lars

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1 2/2] git-p4: suppress non test relevant output
  2015-12-22  8:47     ` Lars Schneider
@ 2015-12-24 11:09       ` Luke Diamand
  0 siblings, 0 replies; 8+ messages in thread
From: Luke Diamand @ 2015-12-24 11:09 UTC (permalink / raw)
  To: Lars Schneider, Junio C Hamano; +Cc: git, sunshine

On 22/12/15 08:47, Lars Schneider wrote:
>
> On 21 Dec 2015, at 21:38, Junio C Hamano <gitster@pobox.com> wrote:
>

>>
>> If so, why not do it there instead?  You seem to run only "kill" to
>> send some signal to a process using this helper function, and it
>> would be silent on its standard output stream (even though it may
>> say "no such process" etc. on its standard error), so it is not
>> clear to me what you are doing with this change here...
>
> If I run git-p4 tests in verbose mode (e.g. "./t9823-git-p4-mock-lfs.sh -v") without this patch then the last lines of the output look like this:
>
>>>> Output Start >>>
> expecting success:
> 	kill_p4d
>
> ./lib-git-p4.sh: line 172: 26289 Killed: 9               while true; do
>      if test $(time_in_seconds) -gt $timeout; then
>          kill -9 $pid; exit 1;
>      fi; sleep 1;
> done
> ok 8 - kill p4d
>
> # passed all 8 test(s)
> 1..8
> <<< Output end <<<
>
> However, I want them to look like this:
>
>>>> Output Start >>>
> expecting success:
> 	kill_p4d
>
> ok 8 - kill p4d
>
> # passed all 8 test(s)
> 1..8
> <<< Output end <<<
>
> This is achieved with the patch. I am no shell expert ... is there a nicer way to achieve the same?

I get your desired output with the unmodified code from origin/next:

$ ./t9823-git-p4-mock-lfs.sh -v
expecting success:
	kill_p4d

ok 8 - kill p4d

# passed all 8 test(s)
1..8

But that's because my shell is symlinked to /bin/dash. I suspect you are 
using bash - when I run this with bash I get your command output. 
Possibly a bash bug?

As Junio says, it seems a bit weird that we have to redirect the stderr 
of that entire expression.

Luke

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-24 11:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20 16:44 [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output larsxschneider
2015-12-20 16:44 ` [PATCH v1 1/2] git-p4: kill p4d watchdog on cleanup larsxschneider
2015-12-20 16:44 ` [PATCH v1 2/2] git-p4: suppress non test relevant output larsxschneider
2015-12-21 20:38   ` Junio C Hamano
2015-12-22  8:47     ` Lars Schneider
2015-12-24 11:09       ` Luke Diamand
2015-12-21 20:31 ` [PATCH v1 0/2] git-p4: kill watchdog and suppress irrelevant output Junio C Hamano
2015-12-22  9:12   ` Lars Schneider

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).