aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conftest.py15
-rw-r--r--packages/meshbay-common/pyproject.toml2
-rw-r--r--packages/meshbay-hub/pyproject.toml2
-rw-r--r--packages/meshbay-node/pyproject.toml2
-rw-r--r--pyproject.toml4
5 files changed, 22 insertions, 3 deletions
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 0000000..38c2f13
--- /dev/null
+++ b/conftest.py
@@ -0,0 +1,15 @@
+"""Repo-wide pytest configuration."""
+
+import asyncio
+import sys
+
+# aiortc's ICE stack (aioice) never completes a loopback DataChannel handshake
+# on Windows' default ProactorEventLoop — test_webrtc_transport.py hangs
+# indefinitely, and with no per-test timeout it took the whole run down with it.
+# A SelectorEventLoop is aiortc's documented requirement on Windows. The
+# trade-off: SelectorEventLoop cannot spawn subprocesses on Windows, so the
+# ffmpeg/ffprobe streaming tests fail here rather than pass and need a per-module
+# Proactor override or skipif(win32). Set at import, before any loop is created;
+# no effect off Windows, where the default policy already works for both.
+if sys.platform == "win32":
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
diff --git a/packages/meshbay-common/pyproject.toml b/packages/meshbay-common/pyproject.toml
index 54de3b4..370d217 100644
--- a/packages/meshbay-common/pyproject.toml
+++ b/packages/meshbay-common/pyproject.toml
@@ -16,7 +16,7 @@ dependencies = [
]
[project.optional-dependencies]
-dev = ["pytest>=8", "pytest-asyncio>=0.24", "ruff>=0.6"]
+dev = ["pytest>=8", "pytest-asyncio>=0.24", "pytest-timeout>=2.3", "ruff>=0.6"]
[tool.hatch.build.targets.wheel]
packages = ["src/meshbay_common"]
diff --git a/packages/meshbay-hub/pyproject.toml b/packages/meshbay-hub/pyproject.toml
index b1597e0..bce0ad2 100644
--- a/packages/meshbay-hub/pyproject.toml
+++ b/packages/meshbay-hub/pyproject.toml
@@ -22,7 +22,7 @@ dependencies = [
]
[project.optional-dependencies]
-dev = ["pytest>=8", "pytest-asyncio>=0.24", "ruff>=0.6", "httpx>=0.28", "argon2-cffi>=21.3"]
+dev = ["pytest>=8", "pytest-asyncio>=0.24", "pytest-timeout>=2.3", "ruff>=0.6", "httpx>=0.28", "argon2-cffi>=21.3"]
[project.scripts]
meshbay-hub = "meshbay_hub.daemon:main"
diff --git a/packages/meshbay-node/pyproject.toml b/packages/meshbay-node/pyproject.toml
index 2aa80aa..1f174cd 100644
--- a/packages/meshbay-node/pyproject.toml
+++ b/packages/meshbay-node/pyproject.toml
@@ -28,7 +28,7 @@ dependencies = [
# camera output) for test_enrich_photo.py — Pillow itself is lenient enough
# to round-trip a flat, non-standard EXIF dict, which would have hidden the
# get_ifd(Exif) bug enrich_photo.py's DateTimeOriginal read had.
-dev = ["pytest>=8", "pytest-asyncio>=0.24", "ruff>=0.6", "piexif>=1.1"]
+dev = ["pytest>=8", "pytest-asyncio>=0.24", "pytest-timeout>=2.3", "ruff>=0.6", "piexif>=1.1"]
[project.scripts]
meshbay-node = "meshbay_node.daemon:main"
diff --git a/pyproject.toml b/pyproject.toml
index 000e037..0c99c1a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -19,3 +19,7 @@ testpaths = [
"packages/meshbay-node/tests",
]
asyncio_mode = "auto"
+# A hung test must not wedge the run — an aiortc handshake on the wrong Windows
+# event loop can block forever with no internal timeout. thread method is used
+# automatically on Windows (no SIGALRM).
+timeout = 60