From e4c098fba4ed0476add1242748f2f0c461f7987f Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 7 May 2016 18:49:43 -0700 Subject: [PATCH] travis: Verify all supervisord jobs are running in production test. This requires a bit of complexity since supervisord automatically restarts failing jobs. --- tools/travis/production-helper | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/tools/travis/production-helper b/tools/travis/production-helper index bf5f130188..d0b35fe474 100755 --- a/tools/travis/production-helper +++ b/tools/travis/production-helper @@ -40,12 +40,32 @@ grep -vi '\(Vary\|Content-Language\|expires\|modified\|saved\|[.][.][.]\|Date\|[ if ! diff -ur /tmp/http-headers-processed ~/success-http-headers.txt; then set +x echo - echo "The HTTP Headers returned from loading the homepage on the server do not match the contents of tools/travis/success-http-headers.txt. Typically, this means that the server threw a 500 when trying to load the homepage." + echo "FAILURE: The HTTP Headers returned from loading the homepage on the server do not match the contents of tools/travis/success-http-headers.txt. Typically, this means that the server threw a 500 when trying to load the homepage." echo "Displaying the contents of the server's error log:" echo cat /var/log/zulip/errors.log exit 1 -else - echo "Production installation test successful!" - exit 0 fi + +echo; echo "Now testing that the supervisord jobs are running properly"; echo +sleep 10 # Guaranteed to have a working supervisord process get an extra digit +if supervisorctl status | grep -vq RUNNING || supervisorctl status | sed 's/^.*uptime //' | grep -q 0:00:0; then + set +x + echo + echo "FAILURE: Supervisor output shows daemons are crashing:" + echo + supervisorctl status + echo + echo "DEBUG: printing Zulip server's error log:" + cat /var/log/zulip/errors.log + echo + echo "DEBUG: printing Zulip server's workers log:" + cat /var/log/zulip/workers.log + echo + echo "DEBUG: printing Zulip server's tornado log:" + cat /var/log/zulip/tornado.log + exit 1 +fi + +echo "Production installation test successful!" +exit 0