Log status json if cluster is unavailable in fdbcli tests

This commit is contained in:
Andrew Noyes 2021-12-22 13:42:20 -08:00 committed by Aaron Molitor
parent 38a97a2e8f
commit 32ebdc6da2
1 changed files with 13 additions and 0 deletions

View File

@ -503,6 +503,18 @@ def profile(logger):
assert run_fdbcli_command('profile', 'client', 'get') == default_profile_client_get_output
@enable_logging()
def test_available(logger):
duration = 0 # seconds we already wait
while not get_value_from_status_json(False, 'client', 'database_status', 'available') and duration < 10:
logger.debug("Sleep for 1 second to wait cluster recovery")
time.sleep(1)
duration += 1
if duration >= 10:
logger.debug(run_fdbcli_command('status', 'json'))
assert False
@enable_logging()
def triggerddteaminfolog(logger):
# this command is straightforward and only has one code path
@ -538,6 +550,7 @@ if __name__ == '__main__':
command_template = [args.build_dir + '/bin/fdbcli', '-C', args.cluster_file, '--exec']
# tests for fdbcli commands
# assertions will fail if fdbcli does not work as expected
test_available()
if args.process_number == 1:
# TODO: disable for now, the change can cause the database unavailable
# advanceversion()