mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 01:42:37 +08:00
Log status json if cluster is unavailable in fdbcli tests
This commit is contained in:
parent
38a97a2e8f
commit
32ebdc6da2
@ -503,6 +503,18 @@ def profile(logger):
|
|||||||
assert run_fdbcli_command('profile', 'client', 'get') == default_profile_client_get_output
|
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()
|
@enable_logging()
|
||||||
def triggerddteaminfolog(logger):
|
def triggerddteaminfolog(logger):
|
||||||
# this command is straightforward and only has one code path
|
# 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']
|
command_template = [args.build_dir + '/bin/fdbcli', '-C', args.cluster_file, '--exec']
|
||||||
# tests for fdbcli commands
|
# tests for fdbcli commands
|
||||||
# assertions will fail if fdbcli does not work as expected
|
# assertions will fail if fdbcli does not work as expected
|
||||||
|
test_available()
|
||||||
if args.process_number == 1:
|
if args.process_number == 1:
|
||||||
# TODO: disable for now, the change can cause the database unavailable
|
# TODO: disable for now, the change can cause the database unavailable
|
||||||
# advanceversion()
|
# advanceversion()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user