Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
xdist-scheduling-exclusive
Advanced tools
pytest-xdist scheduler that runs some tests on dedicated workers. can significantly improve runtime by running long tests on separate workers.
pytest-xdist scheduler that runs some tests on dedicated workers.
Can significantly improve runtime by running long tests on separate workers.
Also in conftest.py
you can find handy reporting capabilities to see how tests were scheduled.
pip install xdist-scheduling-exclusive pytest-xdist
To integrate with your pytest setup, update conftest.py as follows:
from xdist_scheduling_exclusive import ExclusiveLoadScopeScheduling
def pytest_xdist_make_scheduler(config, log):
"""xdist-pytest hook to set scheduler."""
return ExclusiveLoadScopeScheduling(config, log)
And place exclusive tests file exclusive_tests.txt
in tests/resources/
.
You can get the list with pytest's
--durations
option that also sort tests by execution time.
Do not forget to clear execution time from the file - there should be only test node IDs
.
See example in this project tests/resources/exclusive_tests.txt
.
Placing the slowest tests in exclusive_tests.txt
will give you the most benefit.
ExclusiveLoadScheduling
Schedule tests from exclusive_tests.txt
first and on dedicated nodes.ExclusiveLoadFileScheduling
: Place tests from exclusive_tests.txt
to unique scopes
.
Other tests are grouped as in --dist loadfile
: tests from the same file run on the same node.ExclusiveLoadScopeScheduling
: Schedule tests from exclusive_tests.txt
first and on dedicated nodes.
Other tests are grouped as in --dist loadfile
: tests from the same file run on the same node.Do not forget to run . ./activate.sh
.
To see how tests were scheduled use something like
python -m pytest -n 4 --xdist-report -s
make help
FAQs
pytest-xdist scheduler that runs some tests on dedicated workers. can significantly improve runtime by running long tests on separate workers.
We found that xdist-scheduling-exclusive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.