Skip to content

Latest commit

 

History

History
46 lines (25 loc) · 3 KB

File metadata and controls

46 lines (25 loc) · 3 KB
graph LR
    DSession["DSession"]
    WorkerManager["WorkerManager"]
    Remote["Remote"]
    DSession -- "delegates tasks to" --> WorkerManager
    WorkerManager -- "dispatches commands to" --> Remote
    Remote -- "reports to" --> DSession
Loading

CodeBoardingDemoContact

Details

The Inter-Process Communication (IPC) Layer subsystem in pytest-xdist is crucial for enabling distributed test execution by facilitating communication between the central Coordinator (main pytest process) and the various Worker processes. This layer abstracts the underlying communication mechanisms, allowing for the exchange of commands, test items, results, and events.

DSession

As the central orchestrator, DSession acts as the primary communication endpoint for receiving test results, collection reports, and various lifecycle events from all worker processes. It initiates the distributed test run and aggregates all incoming data to provide a unified view of the test session. While it delegates the direct management of worker processes, it remains the ultimate recipient and consolidator of all worker-generated information.

Related Classes/Methods:

WorkerManager

WorkerManager is responsible for the lifecycle management of worker processes from the coordinator's perspective. It sets up new worker nodes, handles file synchronization (rsync) to worker environments, and, critically for IPC, dispatches commands (e.g., "run tests," "steal tests") to the individual Remote Worker instances. It serves as the DSession's primary interface for sending instructions to workers.

Related Classes/Methods:

Remote

Remote represents an individual worker process from the perspective of the coordinator. It is the actual endpoint on the worker side that receives commands dispatched by the WorkerManager and executes the assigned tests. Crucially for IPC, it is responsible for sending back test results, collection reports, and various lifecycle events (e.g., "worker started," "test finished") to the DSession component.

Related Classes/Methods: