Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/packages/granian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ versions:
- filename: granian-2.8.4-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl
sha256: 3a310f43faa291ad17514102236ff006df8712fead48beff726250067828fdef
requires-python: '>=3.10'
- version: 2.8.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From f7906d6f5e6521f65b4eac8e1f5556a966199299 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Thu, 27 Aug 2026 00:00:00 +0000
Subject: [PATCH] tests: wait for the UDS server to accept connections

tests/test_uds.py gives the spawned server a flat 1.5s to import granian,
bind its socket and start accepting. That budget holds on upstream's x86
runners and does not on the slower riscv64 ones, where the whole
tests/test_uds.py http section fails before the socket exists:

httpx.ConnectError: [Errno 2] No such file or directory
httpx.ConnectError: [Errno 111] Connection refused

tests/conftest.py already solves this for the TCP tests by retrying the
connection until it succeeds; do the same here. The wait returns as soon
as the socket answers, so faster hardware pays nothing.

Upstream-Status: To upstream [not yet submitted]

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
tests/test_uds.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/test_uds.py b/tests/test_uds.py
index 332a1a0..c2c91ae 100644
--- a/tests/test_uds.py
+++ b/tests/test_uds.py
@@ -1,6 +1,7 @@
import asyncio
import multiprocessing as mp
import os
+import socket
import stat
import sys
from contextlib import asynccontextmanager
@@ -50,7 +51,17 @@ async def _server(

proc = mp.get_context('spawn').Process(target=_serve, kwargs=kwargs)
proc.start()
- await asyncio.sleep(1.5)
+
+ conn_failures = 0
+ while conn_failures < 10:
+ try:
+ await asyncio.sleep(1.5)
+ with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as sock:
+ sock.settimeout(1)
+ sock.connect('granian.sock')
+ break
+ except Exception:
+ conn_failures += 1

try:
yield
Loading