From f7479cf9e315dd8d8629ee5815777cf83b278877 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 23 Jan 2024 20:39:58 +0200 Subject: [PATCH] Relax the timeouts in the file server test and fix stderr checking in the joystick test --- tests/cmd/file_server.py | 5 +---- tests/cmd/joystick.py | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/cmd/file_server.py b/tests/cmd/file_server.py index 401c47c..fe79703 100644 --- a/tests/cmd/file_server.py +++ b/tests/cmd/file_server.py @@ -10,14 +10,12 @@ import tempfile from pathlib import Path from typing import Tuple, Optional -import pytest import pycyphal from pycyphal.transport.udp import UDPTransport from tests.subprocess import Subprocess from tests.dsdl import OUTPUT_DIR -@pytest.mark.asyncio async def _unittest_file_server_pnp(compiled_dsdl: typing.Any) -> None: from pycyphal.application import make_node, NodeInfo, make_registry from pycyphal.application.file import FileClient @@ -50,7 +48,7 @@ async def _unittest_file_server_pnp(compiled_dsdl: typing.Any) -> None: ), ) try: - fc = FileClient(cln_node, 42, response_timeout=10.0) + fc = FileClient(cln_node, 42, response_timeout=15.0) await asyncio.sleep(3.0) # Let the server initialize. assert srv_proc.alive @@ -90,7 +88,6 @@ async def ls(path: str) -> typing.List[str]: shutil.rmtree(root, ignore_errors=True) # Do not remove on failure for diagnostics. -@pytest.mark.asyncio async def _unittest_file_server_update(compiled_dsdl: typing.Any) -> None: from pycyphal.application import make_node, NodeInfo, make_registry, make_transport, Node from pycyphal.application.plug_and_play import Allocatee diff --git a/tests/cmd/joystick.py b/tests/cmd/joystick.py index 4ab5bd4..ed6d9c6 100644 --- a/tests/cmd/joystick.py +++ b/tests/cmd/joystick.py @@ -4,12 +4,10 @@ # pylint: disable=consider-using-with import asyncio -import pytest from tests.subprocess import Subprocess # noinspection SpellCheckingInspection -@pytest.mark.asyncio async def _unittest_joystick() -> None: asyncio.get_running_loop().slow_callback_duration = 10.0 @@ -22,5 +20,5 @@ async def _unittest_joystick() -> None: await asyncio.sleep(5) assert proc.alive _, stdout, stderr = proc.wait(10.0, interrupt=True) - assert stderr + assert stderr.strip() == "" assert "null" in stdout, "The null controller shall always be available."