diff --git a/h3daemon/h3daemon/daemon.py b/h3daemon/h3daemon/daemon.py index 4462968..e3891e2 100644 --- a/h3daemon/h3daemon/daemon.py +++ b/h3daemon/h3daemon/daemon.py @@ -120,6 +120,8 @@ def healthy(self) -> bool: try: if self._process: assert self._process.is_running() + assert self._master.healthy() + assert self._worker.healthy() assert_peers_healthy(self._master, self._worker) except Exception as exception: debug_exception(exception) diff --git a/h3daemon/tests/test_daemon.py b/h3daemon/tests/test_daemon.py index bf19a0e..8872809 100644 --- a/h3daemon/tests/test_daemon.py +++ b/h3daemon/tests/test_daemon.py @@ -8,7 +8,7 @@ import h3daemon -@pytest.mark.repeat(30) +@pytest.mark.repeat(100) def test_hmmer(tmp_path, files_path: Path): os.chdir(tmp_path) debug_file = Path(tmp_path / "h3daemon_debug.txt") @@ -18,12 +18,14 @@ def test_hmmer(tmp_path, files_path: Path): os.environ["H3DAEMON_DEBUG_FILE"] = str(debug_file) shutil.copy(files_path / "minifam.hmm", Path("minifam.hmm")) - hmmfile = HMMFile(path=Path("minifam.hmm")) - pidfile = h3daemon.spawn(hmmfile, detach=False, force=True) - daemon = h3daemon.possess(pidfile) - daemon.wait_for_readiness() - print(f"daemon.port(): {daemon.port()}") - daemon.shutdown() - with open(debug_file, "r") as f: - print(f.read()) + try: + hmmfile = HMMFile(path=Path("minifam.hmm")) + pidfile = h3daemon.spawn(hmmfile, detach=False, force=True) + daemon = h3daemon.possess(pidfile) + daemon.wait_for_readiness() + print(f"daemon.port(): {daemon.port()}") + daemon.shutdown() + finally: + with open(debug_file, "r") as f: + print(f.read())