ctdb-tests: Actually wait for record to migrate to lmaster node
authorMartin Schwenke <martin@meltin.net>
Tue, 2 Feb 2021 01:45:04 +0000 (12:45 +1100)
committerJeremy Allison <jra@samba.org>
Mon, 8 Feb 2021 22:33:14 +0000 (22:33 +0000)
commit6a81f4317744c5ca82e9291ac172d1fb5b224442
tree65f2aae59b30b3a546f47a33790658275a2919a8
parent1b3d70e9ae95892a70bd0f46ae5bf733c1bc9548
ctdb-tests: Actually wait for record to migrate to lmaster node

This test has been failing with:

  Wait until record is migrated to lmaster node 0
  <30|BAD: node 0 is not dmaster
  dmaster: 1
  rsn: 8
  flags: 0x00010000 MIGRATED_WITH_DATA
  data(6) = "value1"
  *** TEST COMPLETED (RC=1) AT 2021-02-02 06:18:48, CLEANING UP...

This should never happen.  If this really fails then the wait should
time out.

The problem is that wait_until() does:

  "$@" || _rc=$?

and vacuum_test_key_dmaster() currently calls ctdb_test_fail() on
failure, which causes the shell to exit.  Instead, pass a variant to
wait_until() that simply returns the correct status instead of
exiting.

An alternative would be to change the statement in wait_until() to do:

  ("$@") || _rc=$?

so it captures the exit.  However, this is a global change and
requires more thought.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
ctdb/tests/INTEGRATION/database/scripts/local.bash
ctdb/tests/INTEGRATION/database/vacuum.031.locked.sh