Skip to content

Conversation

hfudev
Copy link
Member

@hfudev hfudev commented Sep 11, 2025

closes #294

@hfudev hfudev force-pushed the change/fork-to-spawn branch from 75c7dd6 to 7dc64f9 Compare September 11, 2025 11:54
@hfudev hfudev force-pushed the change/fork-to-spawn branch 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 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.


_b = to_bytes(obj)
try:
super().put(_b)
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

The put method ignores the **kwargs parameter when calling super().put(_b). This could break functionality that relies on timeout or blocking behavior. Should be super().put(_b, **kwargs).

Suggested change
super().put(_b)
super().put(_b, **kwargs)

Copilot uses AI. Check for mistakes.

@@ -742,7 +733,8 @@ def create(
layout = []
try:
global PARAMETRIZED_FIXTURES_CACHE
msg_queue = msg_queue_gn()

msg_queue = MessageQueueManager().MessageQueue()
Copy link
Preview

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

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

Creating a new MessageQueueManager instance here will create an unmanaged queue that won't be properly cleaned up. This should use the session-scoped _mp_manager fixture instead.

Copilot uses AI. Check for mistakes.

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)
1 participant