Skip to content

Commit 6d8918b

Browse files
author
James Souter
committed
fix startup of system softioc tests waiting for log messages
1 parent b826daf commit 6d8918b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616
import pytest
1717
from aioca import purge_channel_caches
18+
from loguru import logger as _logger
1819
from softioc import builder
1920

2021
from fastcs.attributes import AttrR, AttrRW, AttrW
2122
from fastcs.datatypes import Bool, Float, Int, String
2223
from fastcs.launch import build_controller_api
24+
from fastcs.logging import LogLevel, configure_logging
2325
from fastcs.transport.tango.dsr import register_dev
2426
from tests.assertable_controller import MyTestAttributeIORef, MyTestController
2527
from tests.example_p4p_ioc import run as _run_p4p_ioc
@@ -86,6 +88,11 @@ def _run_ioc_as_subprocess(
8688
error_queue: multiprocessing.Queue,
8789
stdout_queue: multiprocessing.Queue,
8890
):
91+
configure_logging(LogLevel.INFO)
92+
# we need to capture log messages from transport
93+
logger = _logger.bind(logger_name="fastcs.transport.epics.ca.transport")
94+
logger.add(print) # forward log messages to stdout
95+
8996
try:
9097
from pytest_cov.embed import cleanup_on_sigterm
9198
except ImportError:
@@ -127,7 +134,7 @@ def run_ioc_as_subprocess(
127134
start_time = time.monotonic()
128135
while True:
129136
try:
130-
if "Running FastCS IOC" in (
137+
if "Running IOC" in (
131138
stdout_queue.get(timeout=ioc_startup_timeout) # type: ignore
132139
):
133140
stdout_queue.get() # get the newline

0 commit comments

Comments
 (0)