Skip to content

refactor: always use multiprocess spawn#374

Merged
hfudev merged 1 commit intomainfrom
change/fork-to-spawn
Sep 12, 2025
Merged

refactor: always use multiprocess spawn#374
hfudev merged 1 commit intomainfrom
change/fork-to-spawn

Conversation

@hfudev
Copy link
Member

@hfudev hfudev commented Sep 11, 2025

closes #294

@hfudev hfudev force-pushed the change/fork-to-spawn branch 2 times, most recently from 7dc64f9 to 73bd4d8 Compare September 11, 2025 13:01
@hfudev hfudev requested a review from Copilot September 11, 2025 13:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the multiprocessing implementation to always use the spawn context instead of platform-specific contexts, which addresses stability issues and ensures consistent behavior across platforms.

  • Replaces platform-specific multiprocessing context selection with unified spawn context
  • Consolidates MessageQueue implementation and moves it to the main module with proper manager support
  • Removes unstable test marker and updates fixture dependencies

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pytest-embedded/__init__.py Introduces centralized MP_CTX using spawn context and consolidated MessageQueue/MessageQueueManager classes
pytest-embedded/plugin.py Updates fixture to use new MessageQueueManager and adds proper MessageQueue cleanup handling
pytest-embedded/log.py Removes old MessageQueue implementation and platform-specific context, imports from main module
pytest-embedded/dut_factory.py Updates imports and removes old context/queue generator functions
pytest-embedded/dut.py Updates type hint to use proper MessageQueue type
tests/test_base.py Removes xfail marker from previously unstable test

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hfudev hfudev force-pushed the change/fork-to-spawn branch from 73bd4d8 to 387b877 Compare September 12, 2025 07:00
@hfudev hfudev merged commit 8849063 into main Sep 12, 2025
5 of 7 checks passed
@hfudev hfudev deleted the change/fork-to-spawn branch September 12, 2025 13:35
@hfudev
Copy link
Member Author

hfudev commented Sep 12, 2025

Tested locally on macOS, all tests are passing.

On Windows, tests are still failing (also failing with the current 1.17.0 version).
I'll merge this PR first.

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.

Rework on multiprocessing fork (RDT-792)

2 participants