Changeset 9a06bbd in mod_gnutls for test


Ignore:
Timestamp:
Feb 4, 2015, 11:27:22 AM (5 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
8731286, c4a015b
Parents:
302965e
Message:

Use flock instead of delays to protect Apache

The "sleep" call before each Apache start slows tests down, but removing
it leads to occasional failures, presumably due to a mid-shutdown Apache
process getting in the way of a starting one. Use a lock file to prevent
that while removing the sleep.

Location:
test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • test/.gitignore

    r302965e r9a06bbd  
    1616*.log
    1717*.trs
     18test.lock
  • test/TestMakefile

    r302965e r9a06bbd  
    1515export TEST_QUERY_DELAY ?= 2
    1616
     17TEST_LOCK := ./test.lock
     18
    1719all: setup.done
    18         ./runtests
     20        TEST_LOCK=$(TEST_LOCK) ./runtests
    1921
    2022t-%: setup.done
    21         ./runtests $@
     23        TEST_LOCK=$(TEST_LOCK) ./runtests $@
    2224
    2325
  • test/runtests

    r302965e r9a06bbd  
    66
    77tests="${1##t-}"
     8
     9if [ -n "${TEST_LOCK}" ]; then
     10    TEST_LOCK="$(realpath ${TEST_LOCK})"
     11    flock_cmd="flock -w 10 ${TEST_LOCK}"
     12fi
    813
    914BADVARS=0
     
    5964fi
    6065
    61 for t in $tests; do
    62     sleep "$TEST_GAP"
     66for t in $tests; do
     67    if [ -z "${flock_cmd}" ]; then
     68        echo "Warning: no lock file set"
     69        sleep "$TEST_GAP"
     70    fi
    6371    export TEST_NAME="$(basename "$t")"
    6472    output="../../outputs/${TEST_NAME}.output"
     
    7381    trap apache_down_err EXIT
    7482    if [ -n "${USE_MSVA}" ]; then
    75         MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT" /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k start || [ -e fail.server ]
     83        ${flock_cmd} \
     84            MONKEYSPHERE_VALIDATION_AGENT_SOCKET="http://127.0.0.1:$MSVA_PORT" \
     85            /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k start \
     86            || [ -e fail.server ]
    7687    else
    77         /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k start || [ -e fail.server ]
     88        ${flock_cmd} \
     89            /usr/sbin/apache2 -f "$(pwd)/apache.conf" -k start \
     90            || [ -e fail.server ]
    7891    fi
    7992
Note: See TracChangeset for help on using the changeset viewer.