summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2020-02-21 20:35:24 +1100
committerAmitay Isaacs <amitay@samba.org>2020-03-02 10:39:28 +0000
commit7cff3ed12cd807b1c7feb0a4e234d52ee2232138 (patch)
treecfde84b12452fec6f9de3ddd96d5e4ecc10d07fc /ctdb
parent84172ae7cbcc9ccc3a20ac942d4749b28df0f7f5 (diff)
downloadsamba-7cff3ed12cd807b1c7feb0a4e234d52ee2232138.tar.gz
ctdb-tests: Use a local "ctdb shutdown" command to avoid a race
When "ctdb shutdown" is run with -n <N> it does not wait for the node <N>'s ctdbd to go down but exits immediately. This means that the local_daemons.sh shutdown command can find the PID file still present and then attempt the shutdown, but the daemon can have exited between the check and the shutdown. Although the test waits until the node is disconnected, the transport is taken down just before the exit, so this does not guarantee the daemon has exited. A local shutdown command (no -n <N>) waits until the socket disconnects and this happens *after* the PID file is gone, so this is safe to use with the local_daemons.sh shutdown command. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Mar 2 10:39:28 UTC 2020 on sn-devel-184
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tests/INTEGRATION/simple/basics.003.ping.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/ctdb/tests/INTEGRATION/simple/basics.003.ping.sh b/ctdb/tests/INTEGRATION/simple/basics.003.ping.sh
index b911b896f99..1ff37b903f7 100755
--- a/ctdb/tests/INTEGRATION/simple/basics.003.ping.sh
+++ b/ctdb/tests/INTEGRATION/simple/basics.003.ping.sh
@@ -41,7 +41,7 @@ sanity_check_output \
1 \
'^response from 1 time=-?[.0-9]+ sec[[:space:]]+\([[:digit:]]+ clients\)$'
-try_command_on_node -v 0 "$CTDB shutdown -n 1"
+ctdb_onnode -v 1 "shutdown"
wait_until_node_has_status 1 disconnected 30 0