Merge lp:~fginther/bamf/ignore-kill-return into lp:bamf/0.4

Proposed by Francis Ginther
Status: Merged
Approved by: Ted Gould
Approved revision: 504
Merged at revision: 506
Proposed branch: lp:~fginther/bamf/ignore-kill-return
Merge into: lp:bamf/0.4
Diff against target: 12 lines (+1/-1)
1 file modified
tests/run-xvfb.sh (+1/-1)
To merge this branch: bzr merge lp:~fginther/bamf/ignore-kill-return
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+138316@code.launchpad.net

Commit message

Fix test failure caused when xvfb exits before script has a chance to kill it on script exit

The xvfb process may or may not be present when the test script exits. Allow this with the addition of "||true".

Description of the change

When running headless tests, the xvfb process may have already exited when the run-xvfb.sh script test tries to kill it. These leads to the test returning failure.

The fix is to add "|| true" to the kill command, effectively causing the kill return value to be ignored.

Testing:
 - "make check" with headless tests enabled.
 - Built inside quantal and raring pbuilder chroots with headless tests enabled.
 - Tested in jenkins environment where problem was originally reported.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

It seems fair here...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/run-xvfb.sh'
2--- tests/run-xvfb.sh 2012-11-15 17:45:29 +0000
3+++ tests/run-xvfb.sh 2012-12-05 21:16:33 +0000
4@@ -10,7 +10,7 @@
5
6 $XVFB_PATH -ac -noreset -screen 0 800x600x16 -help 2>/dev/null 1>&2
7 XID=`for id in 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 ; do test -e /tmp/.X$id-lock || { echo $id; exit 0; }; done; exit 1`
8-{ $XVFB_PATH -ac -noreset -screen 0 800x600x16 :$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null > $xvfb_log 2>&1 & trap "kill -15 $! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; }
9+{ $XVFB_PATH -ac -noreset -screen 0 800x600x16 :$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null > $xvfb_log 2>&1 & trap "kill -15 $! || true" 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; }
10 DISPLAY=:$XID
11 export DISPLAY
12 fi

Subscribers

People subscribed via source and target branches