Skip to content

Commit

Permalink
Relax the timeouts in the file server test and fix stderr checking in…
Browse files Browse the repository at this point in the history
… the joystick test
  • Loading branch information
pavel-kirienko committed Jan 23, 2024
1 parent fdd8dc2 commit b8939e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions tests/cmd/file_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions tests/cmd/joystick.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,6 +19,5 @@ async def _unittest_joystick() -> None:
assert proc.alive
await asyncio.sleep(5)
assert proc.alive
_, stdout, stderr = proc.wait(10.0, interrupt=True)
assert stderr
_, stdout, _stderr = proc.wait(10.0, interrupt=True)
assert "null" in stdout, "The null controller shall always be available."

0 comments on commit b8939e8

Please sign in to comment.