qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH RESEND 0/2] avoid Travis CI "no log output for 10 minutes" failure
@ 2017-07-13 10:03 Philippe Mathieu-Daudé
  2017-07-13 10:03 ` [Qemu-devel] [RFC PATCH RESEND 1/2] scripts: helper to keep console alive Philippe Mathieu-Daudé
  2017-07-13 10:03 ` [Qemu-devel] [RFC PATCH RESEND 2/2] travis: use console aliveness script Philippe Mathieu-Daudé
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-13 10:03 UTC (permalink / raw)
  To: Alex Bennée, Paolo Bonzini, Stefan Hajnoczi, Peter Maydell,
	Thomas Huth, Fam Zheng, qemu-devel
  Cc: Philippe Mathieu-Daudé

Hi, still trying to reduce Travis false negatives...

Suggested yesterday on IRC:
  pm215: this one seems to be that we hit the "10 minutes with no output" limit
  stefanha: f4bug: We could literally have a SIGALRM that wakes up to print out a '.' :-)

Let's try with an easy shell script.

This doesn't solve the 50min TO problem which is a different issue, but seems
to work a bit more stable:

https://travis-ci.org/philmd/qemu/builds/253032034

tagged 'RFC' because it's just a PoC script without comment.

Regards,

Phil.

PD: sorry, resent since I forgot to Cc: qemu-devel@nongnu.org :S

Philippe Mathieu-Daudé (2):
  scripts: helper to keep console alive
  travis: use console aliveness script

 .travis.yml          |  2 +-
 MAINTAINERS          |  1 +
 scripts/aliveness.sh | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100755 scripts/aliveness.sh

-- 
2.13.2

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

* [Qemu-devel] [RFC PATCH RESEND 1/2] scripts: helper to keep console alive
  2017-07-13 10:03 [Qemu-devel] [RFC PATCH RESEND 0/2] avoid Travis CI "no log output for 10 minutes" failure Philippe Mathieu-Daudé
@ 2017-07-13 10:03 ` Philippe Mathieu-Daudé
  2017-07-13 11:38   ` Eric Blake
  2017-07-13 10:03 ` [Qemu-devel] [RFC PATCH RESEND 2/2] travis: use console aliveness script Philippe Mathieu-Daudé
  1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-13 10:03 UTC (permalink / raw)
  To: Alex Bennée, Paolo Bonzini, Stefan Hajnoczi, Peter Maydell,
	Thomas Huth, Fam Zheng, qemu-devel
  Cc: Philippe Mathieu-Daudé

useful to avoid Travis CI jobs getting killed after 10min of inactivity.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 MAINTAINERS          |  1 +
 scripts/aliveness.sh | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100755 scripts/aliveness.sh

diff --git a/MAINTAINERS b/MAINTAINERS
index 9529c9484c..c39f418a13 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1866,6 +1866,7 @@ S: Maintained
 F: .travis.yml
 F: .shippable.yml
 F: tests/docker/
+F: scripts/aliveness.sh
 W: https://travis-ci.org/qemu/qemu
 W: https://app.shippable.com/github/qemu/qemu
 W: http://patchew.org/QEMU/
diff --git a/scripts/aliveness.sh b/scripts/aliveness.sh
new file mode 100755
index 0000000000..1c2b6136b9
--- /dev/null
+++ b/scripts/aliveness.sh
@@ -0,0 +1,32 @@
+#! /usr/bin/env sh
+#
+# Send an "Alive!" message regularly to stderr
+#
+# Copyright (C) 2017 Philippe Mathieu-Daudé
+#
+# Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
+#
+# This work is licensed under the terms of the GNU LGPL, version 2+.
+# See the COPYING file in the top-level directory.
+
+TIMEOUT_S=$1
+shift 1
+{
+  set -e
+  while true
+  do
+    sleep ${TIMEOUT_S}
+    echo "Alive!" >&2
+  done
+} &
+WATCHDOG_PID=$!
+
+cleanup() {
+    echo "killing watchdog ${WATCHDOG_PID}" >&2
+    kill -TERM ${WATCHDOG_PID}
+    exit $((1 - $#))
+}
+trap cleanup INT
+
+$*
+cleanup 0
-- 
2.13.2

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

* [Qemu-devel] [RFC PATCH RESEND 2/2] travis: use console aliveness script
  2017-07-13 10:03 [Qemu-devel] [RFC PATCH RESEND 0/2] avoid Travis CI "no log output for 10 minutes" failure Philippe Mathieu-Daudé
  2017-07-13 10:03 ` [Qemu-devel] [RFC PATCH RESEND 1/2] scripts: helper to keep console alive Philippe Mathieu-Daudé
@ 2017-07-13 10:03 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-07-13 10:03 UTC (permalink / raw)
  To: Alex Bennée, Paolo Bonzini, Stefan Hajnoczi, Peter Maydell,
	Thomas Huth, Fam Zheng, qemu-devel
  Cc: Philippe Mathieu-Daudé

Travis CI has specific time limits for each job, and will stop the build and
add an error message to the build log in the following situation[s]:
- A job produces no log output for 10 minutes

See: https://docs.travis-ci.com/user/customizing-the-build#build-timeouts

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 27a2d9cfb3..032d111bb4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -45,7 +45,7 @@ notifications:
     on_failure: always
 env:
   global:
-    - TEST_CMD="make check"
+    - TEST_CMD="scripts/aliveness.sh 69 make check"
   matrix:
     - CONFIG=""
     - CONFIG="--enable-debug --enable-debug-tcg --enable-trace-backends=log"
-- 
2.13.2

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

* Re: [Qemu-devel] [RFC PATCH RESEND 1/2] scripts: helper to keep console alive
  2017-07-13 10:03 ` [Qemu-devel] [RFC PATCH RESEND 1/2] scripts: helper to keep console alive Philippe Mathieu-Daudé
@ 2017-07-13 11:38   ` Eric Blake
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2017-07-13 11:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Alex Bennée, Paolo Bonzini,
	Stefan Hajnoczi, Peter Maydell, Thomas Huth, Fam Zheng,
	qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1909 bytes --]

On 07/13/2017 05:03 AM, Philippe Mathieu-Daudé wrote:
> useful to avoid Travis CI jobs getting killed after 10min of inactivity.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  MAINTAINERS          |  1 +
>  scripts/aliveness.sh | 32 ++++++++++++++++++++++++++++++++
>  2 files changed, 33 insertions(+)
>  create mode 100755 scripts/aliveness.sh
> 

> +++ b/scripts/aliveness.sh
> @@ -0,0 +1,32 @@
> +#! /usr/bin/env sh

Overkill.  /bin/sh exists everywhere, the only need for using 'env' is
where a program does not have a reliable installation path across platforms.

> +#
> +# Send an "Alive!" message regularly to stderr
> +#
> +# Copyright (C) 2017 Philippe Mathieu-Daudé
> +#
> +# Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
> +#
> +# This work is licensed under the terms of the GNU LGPL, version 2+.
> +# See the COPYING file in the top-level directory.
> +
> +TIMEOUT_S=$1
> +shift 1
> +{
> +  set -e
> +  while true
> +  do
> +    sleep ${TIMEOUT_S}
> +    echo "Alive!" >&2
> +  done
> +} &
> +WATCHDOG_PID=$!
> +
> +cleanup() {
> +    echo "killing watchdog ${WATCHDOG_PID}" >&2
> +    kill -TERM ${WATCHDOG_PID}
> +    exit $((1 - $#))

This looks odd - what are you really trying to accomplish here?  A
different exit status according to whether the watchdog exited normally
or was killed?  A reflection of the exit status of the command being run
in parallel with the watchdog?

> +}
> +trap cleanup INT

Don't you want to clean up on more than just INT?  The more typical
spelling is:

trap cleanup 0 1 2 3 15

> +
> +$*

Huh? Oh, you're expecting this to be called as "aliveness.sh $TIMEOUT
$command to run".  Some usage comments would be nice.

> +cleanup 0
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

end of thread, other threads:[~2017-07-13 11:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13 10:03 [Qemu-devel] [RFC PATCH RESEND 0/2] avoid Travis CI "no log output for 10 minutes" failure Philippe Mathieu-Daudé
2017-07-13 10:03 ` [Qemu-devel] [RFC PATCH RESEND 1/2] scripts: helper to keep console alive Philippe Mathieu-Daudé
2017-07-13 11:38   ` Eric Blake
2017-07-13 10:03 ` [Qemu-devel] [RFC PATCH RESEND 2/2] travis: use console aliveness script Philippe Mathieu-Daudé

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 NNTP newsgroup(s).