Skip to content

test: skip real-transport tests on Windows (they require os.fork) - #332

Closed
K4bain wants to merge 1 commit into
tadata-org:mainfrom
K4bain:fix/windows-fork-tests
Closed

K4bain wants to merge 1 commit into
tadata-org:mainfrom
K4bain:fix/windows-fork-tests

Conversation

@K4bain

@K4bain K4bain commented Aug 27, 2026

Copy link
Copy Markdown

The server fixture in both real-transport test modules spawns the FastAPI app in a subprocess via multiprocessing.get_context("fork"):

ctx = multiprocessing.get_context("fork")

os.fork() does not exist on Windows, so every test in test_sse_real_transport.py and test_http_real_transport.py errors with ValueError: cannot find context for 'fork' when the suite is run on Windows (fork was chosen over spawn to avoid pickling the FastAPI app, so there is no drop-in substitute).

This PR adds a module-level pytestmark = pytest.mark.skipif(os.name == "nt", ...) to both modules, with a comment explaining why. Behavior on POSIX (including CI) is unchanged — the tests still run there. Locally on Windows the suite now reports 69 passed, 20 skipped instead of 20 errors.

@K4bain

K4bain commented Sep 14, 2026

Copy link
Copy Markdown
Author

Closing for housekeeping - the repo had no reviewer engagement and we are re-approaching these areas through a narrower pipeline. Happy to reopen on request.

@K4bain K4bain closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant