Skip to content

Commit 9fb78bd

Browse files
authored
chore(test_wsgi): skip wsgiref tests on macos (#2516)
* fix(test): actually use the given timeout in "request lite" * chore: debug on Darwin... * chore: improved debugging on Darwin * chore(test_wsgi): use threading instead of multiprocessing on Darwin * chore(test_wsgi): try 127.0.0.1 instead of localhost, maybe macos-15 has issues with it? * chore(test_wsgi): skip testing on macos until the issues are resolved
1 parent eaf207f commit 9fb78bd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def request(self, method, url, data=None, headers=None, timeout=None):
173173
headers = headers or {}
174174
timeout = timeout or self.DEFAULT_TIMEOUT
175175

176-
conn = http.client.HTTPConnection(parsed.netloc)
176+
conn = http.client.HTTPConnection(parsed.netloc, timeout=timeout)
177177
conn.request(method, uri, body=data, headers=headers)
178178
return self.Response(conn.getresponse())
179179

tests/test_wsgi.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import multiprocessing
22
import os
33
import os.path
4+
import platform
45
import time
56
import wsgiref.simple_server
67

@@ -16,6 +17,10 @@
1617
_START_ATTEMPTS = 3
1718

1819

20+
@pytest.mark.skipif(
21+
platform.system() == 'Darwin',
22+
reason='Non-deterministic issues with macos-15 GitHub Actions runners',
23+
)
1924
class TestWSGIServer:
2025
def test_get(self, requests_lite, server_base_url):
2126
resp = requests_lite.get(server_base_url)
@@ -113,10 +118,10 @@ def _start_server(port, base_url, requests_lite):
113118
stop_event = multiprocessing.Event()
114119
process = multiprocessing.Process(
115120
target=_run_server,
116-
daemon=True,
117121
# NOTE(kgriffs): Pass these explicitly since if multiprocessing is
118122
# using the 'spawn' start method, we can't depend on closures.
119123
args=(stop_event, _SERVER_HOST, port),
124+
daemon=True,
120125
)
121126

122127
process.start()

0 commit comments

Comments
 (0)