From 0b6d43fa6fb0f2ba66c430955dd1c9c771987c58 Mon Sep 17 00:00:00 2001 From: Chaoguang Lin Date: Wed, 21 Jul 2021 18:36:05 +0000 Subject: [PATCH 1/2] Fix exclude test and re-enable it in ctest --- bindings/python/tests/fdbcli_tests.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bindings/python/tests/fdbcli_tests.py b/bindings/python/tests/fdbcli_tests.py index 49fd45c632..d18ef9f6d8 100755 --- a/bindings/python/tests/fdbcli_tests.py +++ b/bindings/python/tests/fdbcli_tests.py @@ -381,12 +381,19 @@ def exclude(logger): while True: logger.debug("Excluding process: {}".format(excluded_address)) error_message = run_fdbcli_command_and_get_error('exclude', excluded_address) - if not error_message: + if error_message == 'WARNING: {} is a coordinator!'.format(excluded_address): + # exclude coordinator will fail, verify the randomly selected process is the coordinator + coordinator_list = get_value_from_status_json(True, 'client', 'coordinators', 'coordinators') + assert len(coordinator_list) == 1 + assert coordinator_list[0]['address'] == excluded_address break + elif not error_message: + break + else: + logger.debug("Error message: {}\n".format(error_message)) logger.debug("Retry exclude after 1 second") time.sleep(1) output2 = run_fdbcli_command('exclude') - # logger.debug(output3) assert 'There are currently 1 servers or localities being excluded from the database' in output2 assert excluded_address in output2 run_fdbcli_command('include', excluded_address) @@ -416,6 +423,6 @@ if __name__ == '__main__': else: assert process_number > 1, "Process number should be positive" coordinators() - # exclude() + exclude() From 6bf5df6cc5f9f35aff94a78d9c2b22f0d49fbac2 Mon Sep 17 00:00:00 2001 From: Chaoguang Lin Date: Wed, 21 Jul 2021 18:38:13 +0000 Subject: [PATCH 2/2] Update comments in fdbcli_tests.py --- bindings/python/tests/fdbcli_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/tests/fdbcli_tests.py b/bindings/python/tests/fdbcli_tests.py index d18ef9f6d8..8004f77f30 100755 --- a/bindings/python/tests/fdbcli_tests.py +++ b/bindings/python/tests/fdbcli_tests.py @@ -382,7 +382,7 @@ def exclude(logger): logger.debug("Excluding process: {}".format(excluded_address)) error_message = run_fdbcli_command_and_get_error('exclude', excluded_address) if error_message == 'WARNING: {} is a coordinator!'.format(excluded_address): - # exclude coordinator will fail, verify the randomly selected process is the coordinator + # exclude coordinator will print the warning, verify the randomly selected process is the coordinator coordinator_list = get_value_from_status_json(True, 'client', 'coordinators', 'coordinators') assert len(coordinator_list) == 1 assert coordinator_list[0]['address'] == excluded_address