diff options
| author | Stephen Sorriaux <stephen.sorriaux@gmail.com> | 2023-04-10 17:13:59 -0400 |
|---|---|---|
| committer | Stephen Sorriaux <stephen.sorriaux@gmail.com> | 2023-04-24 14:04:44 -0400 |
| commit | 2c36d699fbf0569f490d5bfa66fa85fbdc68dea3 (patch) | |
| tree | 931d2caa9ec9f59ea167f78530fc484fe103e74b /kazoo/tests | |
| parent | d218dc970575f5d6042c14060d36e118a8c92e57 (diff) | |
| download | kazoo-master.tar.gz | |
Activate `pytest`'s `logcli` setting to better read the client lifecycle during testing.
Add `log()` function to KazooTestHarness class so that it is possible to log like crazy when something is not working
Display the ZK client port in logs when starting a ZK server (useful for test "debug")
Be able to get more than the last 100 lines of ZK logs (can be useful, believe me)
Diffstat (limited to 'kazoo/tests')
| -rw-r--r-- | kazoo/tests/conftest.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kazoo/tests/conftest.py b/kazoo/tests/conftest.py index eef9965..931fd84 100644 --- a/kazoo/tests/conftest.py +++ b/kazoo/tests/conftest.py @@ -4,8 +4,10 @@ log = logging.getLogger(__name__) def pytest_exception_interact(node, call, report): - if hasattr(node._testcase, "cluster"): + try: cluster = node._testcase.cluster log.error("Zookeeper cluster logs:") for logs in cluster.get_logs(): log.error(logs) + except Exception: + log.exception("Cannot get ZK logs:") |
