Skip to content

Commit 7a460c0

Browse files
authored
Only emit path to daemon log path in pytest tmp folder (#6698)
When working with daemon, fixture started_daemon_worker will start daemon through circus and writing logs to the log file stay in the pytest tmp folder. It is not straightforward to find where the log file is to check the daemon log that related to the hang engine tests. The PR write a log in debug level to print the location of the daemon log.
1 parent d71ef98 commit 7a460c0

File tree

3 files changed

+192
-175
lines changed

3 files changed

+192
-175
lines changed

.readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ build:
1717
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-uv
1818
pre_create_environment:
1919
- asdf plugin add uv
20-
- asdf install uv 0.5.17
21-
- asdf global uv 0.5.17
20+
- asdf install uv 0.5.20
21+
- asdf global uv 0.5.20
2222
create_environment:
2323
- uv venv
2424
install:

src/aiida/tools/pytest_fixtures/daemon.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
from __future__ import annotations
44

5+
import logging
56
import pathlib
67
import typing as t
78

89
import pytest
910

1011
if t.TYPE_CHECKING:
1112
from aiida.engine import Process, ProcessBuilder
13+
from aiida.engine.daemon.client import DaemonClient
1214
from aiida.orm import ProcessNode
1315

1416

@@ -47,7 +49,7 @@ def test(daemon_client):
4749

4850

4951
@pytest.fixture
50-
def started_daemon_client(daemon_client):
52+
def started_daemon_client(daemon_client: 'DaemonClient'):
5153
"""Ensure that the daemon is running for the test profile and return the associated client.
5254
5355
Usage::
@@ -60,11 +62,14 @@ def test(started_daemon_client):
6062
daemon_client.start_daemon()
6163
assert daemon_client.is_daemon_running
6264

65+
logger = logging.getLogger('tests.daemon:started_daemon_client')
66+
logger.debug(f'Daemon log file is located at: {daemon_client.daemon_log_file}')
67+
6368
yield daemon_client
6469

6570

6671
@pytest.fixture
67-
def stopped_daemon_client(daemon_client):
72+
def stopped_daemon_client(daemon_client: 'DaemonClient'):
6873
"""Ensure that the daemon is not running for the test profile and return the associated client.
6974
7075
Usage::

0 commit comments

Comments
 (0)