]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Stop cross-talk between reclock tests
authorMartin Schwenke <martin@meltin.net>
Mon, 1 Aug 2016 04:07:04 +0000 (14:07 +1000)
committerVolker Lendecke <vl@samba.org>
Mon, 1 Aug 2016 15:53:27 +0000 (17:53 +0200)
On a busy system the backgrounded counter reset can survive into the
next test and interfere with its result.

To avoid this, wait until all forks of 01.reclock exit before
continuing on to the next test.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug  1 17:53:27 CEST 2016 on sn-devel-144

ctdb/tests/eventscripts/scripts/local.sh

index 7f6c91de3f5a0908d8fee0612217e514af6301db..61a033a1b6cce9aa38cdc870cd5b0a64a5569748 100644 (file)
@@ -1132,10 +1132,21 @@ program $_rpc_service${_ver:+ version }${_ver} is not available"
 
 # Recovery lock fakery
 
+cleanup_reclock ()
+{
+       _pattern="${script_dir}/${script}"
+       while pgrep -f "$_pattern" >/dev/null ; do
+               echo "Waiting for backgrounded ${script} to exit..."
+               (FAKE_SLEEP_REALLY=yes sleep 1)
+       done
+}
+
 setup_reclock ()
 {
        CTDB_RECOVERY_LOCK=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR")
        export CTDB_RECOVERY_LOCK
+
+       test_cleanup cleanup_reclock
 }
 
 ######################################################################