Skip to content

Use forkserver for tests on MacOS#1557

Merged
jph00 merged 1 commit intomainfrom
fix/1256-fix-macos-forkserver
Jan 27, 2026
Merged

Use forkserver for tests on MacOS#1557
jph00 merged 1 commit intomainfrom
fix/1256-fix-macos-forkserver

Conversation

@KeremTurgutlu
Copy link
Contributor

Fix BrokenProcessPool error on macOS by using forkserver method

Fixes #1256

Problem

nbdev_test fails on macOS with BrokenProcessPool error due to Objective-C runtime fork-safety issues. Current workarounds require setting environment variables or using --n_workers 0.

Solution

Use forkserver multiprocessing method on macOS when running outside notebooks. This avoids fork-safety issues by forking from a clean server process before problematic libraries are loaded.

Changes

  • Updated nbdev_test to use {'method':'forkserver'} on macOS (sys.platform=='darwin') when not in notebooks
  • Maintains existing behavior for other platforms

@KeremTurgutlu KeremTurgutlu requested a review from jph00 January 22, 2026 07:49
@jph00 jph00 merged commit 26e4db4 into main Jan 27, 2026
8 checks passed
@jph00 jph00 deleted the fix/1256-fix-macos-forkserver branch January 27, 2026 17:34
@jph00
Copy link
Contributor

jph00 commented Jan 27, 2026

Thank you!

@jph00 jph00 changed the title fix-macos-forkserver Use forkserver for tests on MacOS Jan 27, 2026
@jph00 jph00 added the enhancement New feature or request label Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nbdev_test breaks on Apple M1 due to BrokenAccessPool

2 participants