Skip to content

Performance Degradation in Kubernetes with pytest-xdist #1108

Open
@OriMeyuhas

Description

@OriMeyuhas

I’m experiencing significant performance degradation when running tests with pytest-xdist in a Kubernetes environment compared to running them locally.

Environment Details

Local Machine:

•	CPU: 8 cores
•	Memory: 16 GB
•	Command: pytest -n 8 (all distributions are working well)
•	Running Time: 10-15 minutes
•	Screenshot: 

image

Dedicated Machine on Kubernetes:

•	Pod Configuration:
•	CPU: 24 cores
•	Memory: 48 GB
•	Resources Requests and Limits: Correctly set
•	Command: pytest -n 21 --dist=loadfile
•	If using --dist=load or --dist=worksteal, workers are getting crushed and tests fail.
•	Running Time: 35-57 minutes
•	Screenshot: 

Screenshot 2024-07-11 at 18 08 05

Despite having significantly more resources in Kubernetes, the test running time is much longer, and using --dist=load or --dist=worksteal causes failures.

I need help understanding why this performance degradation is happening and how to optimize pytest-xdist in Kubernetes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions