From: Carsten Schoenert Date: Sun, 16 Mar 2025 08:56:18 +0200 Subject: tests: Skip tests expect to fail on riscv64 These tests are flaky on riscv64 and expected to fail. Mostly as the ASGI side isn't communicating, so the problem seems to be outside litestar (on the CI infratructure). Forwarded: not-needed --- tests/e2e/test_routing/test_path_mounting.py | 2 ++ tests/e2e/test_routing/test_path_resolution.py | 4 ++++ tests/unit/test_handlers/test_websocket_handlers/test_stream.py | 2 ++ 3 files changed, 8 insertions(+) diff --git a/tests/e2e/test_routing/test_path_mounting.py b/tests/e2e/test_routing/test_path_mounting.py index c317bb0..ce90f82 100644 --- a/tests/e2e/test_routing/test_path_mounting.py +++ b/tests/e2e/test_routing/test_path_mounting.py @@ -2,6 +2,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Callable, List import httpx +import platform import pytest from _pytest.monkeypatch import MonkeyPatch @@ -107,6 +108,7 @@ def test_does_not_support_asgi_handlers_on_same_level_as_websockets() -> None: ) @pytest.mark.xdist_group("live_server_test") @pytest.mark.server_integration +@pytest.mark.skipif(platform.machine() == "riscv64" , reason="Expected to fail on riscv64, test is running too flaky.") def test_path_mounting_live_server( tmp_path: Path, monkeypatch: MonkeyPatch, server_command: List[str], run_server: Callable[[str, List[str]], None] ) -> None: diff --git a/tests/e2e/test_routing/test_path_resolution.py b/tests/e2e/test_routing/test_path_resolution.py index f650877..11aa3f7 100644 --- a/tests/e2e/test_routing/test_path_resolution.py +++ b/tests/e2e/test_routing/test_path_resolution.py @@ -2,6 +2,7 @@ from pathlib import Path from typing import Any, Callable, List, Optional, Type import httpx +import platform import pytest from _pytest.monkeypatch import MonkeyPatch @@ -310,6 +311,7 @@ def test_base_path_param_resolution_2() -> None: ) @pytest.mark.xdist_group("live_server_test") @pytest.mark.server_integration +@pytest.mark.skipif(platform.machine() == "riscv64" , reason="Expected to fail on riscv64, test is running too flaky.") def test_server_root_path_handling( tmp_path: Path, monkeypatch: MonkeyPatch, server_command: List[str], run_server: Callable[[str, List[str]], None] ) -> None: @@ -340,6 +342,7 @@ app = Litestar(route_handlers=[handler]) ) @pytest.mark.xdist_group("live_server_test") @pytest.mark.server_integration +@pytest.mark.skipif(platform.machine() == "riscv64" , reason="Expected to fail on riscv64, test is running too flaky.") def test_server_root_path_handling_empty_path( tmp_path: Path, monkeypatch: MonkeyPatch, server_command: List[str], run_server: Callable[[str, List[str]], None] ) -> None: @@ -374,6 +377,7 @@ app = Litestar(route_handlers=[pathfinder], debug=True) ) @pytest.mark.xdist_group("live_server_test") @pytest.mark.server_integration +@pytest.mark.skipif(platform.machine() == "riscv64" , reason="Expected to fail on riscv64, test is running too flaky.") def test_no_path_traversal_from_static_directory( tmp_path: Path, monkeypatch: MonkeyPatch, server_command: List[str], run_server: Callable[[str, List[str]], None] ) -> None: diff --git a/tests/unit/test_handlers/test_websocket_handlers/test_stream.py b/tests/unit/test_handlers/test_websocket_handlers/test_stream.py index 99bf2c9..62db7e7 100644 --- a/tests/unit/test_handlers/test_websocket_handlers/test_stream.py +++ b/tests/unit/test_handlers/test_websocket_handlers/test_stream.py @@ -5,6 +5,7 @@ import dataclasses from typing import TYPE_CHECKING, AsyncGenerator, Dict, Generator from unittest.mock import MagicMock +import platform import pytest from litestar import Controller, Litestar, WebSocket @@ -29,6 +30,7 @@ def test_websocket_stream() -> None: assert ws.receive_text(timeout=0.1) == "bar" +@pytest.mark.skipif(platform.machine() == "riscv64" , reason="Expected to fail on riscv64, test is running too flaky.") def test_websocket_stream_in_controller() -> None: class MyController(Controller): @websocket_stream("/")