Proxy gateways do not run workers, and are meant to be passed with the
`via` attribute to additional gateways.
They are useful for running multiple workers on remote machines.
Example usage:
```
pytest -sv --dist=load --px "id=my_proxy//socket=IP:PORT" --tx "5*popen//via=my_proxy"
```
Proxy gateways do not run workers, anda re meant to be passed
We need to use string annotations otherwise we get this error:
```
ValueError: ("the use of non-builtin globals isn't supported", ['execnet', 'Any'])
```
Either unschedule all requested tests, or none if it's not possible -
if some of the requested tests have already been processed by the time
the request arrives. It may happen if the worker runs tests faster than
the controller receives and processes status updates. But in this case
maybe it's just better to let the worker keep running.
This is a prerequisite for group/scope support in worksteal scheduler -
so they won't be broken up incorrectly.
This change could break schedulers that use "steal" command. However:
1) worksteal scheduler doesn't need any adjustments.
2) I'm not aware of any external schedulers relying on this command yet.
So I think it's better to keep the protocol simple, not complicate it for
imaginary compatibility with some unknown and likely non-existent
schedulers.
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Cache execnet gateway info during WorkerController setup for backward
compatibility, in order to avoid a later main_thread_only deadlock
error triggered when pytest-cov calls rinfo after the main thread is
already busy. See pytest-dev/execnet#274 for corresponding test case.
Fixes: 20e3ac774e ("Use execnet main_thread_only execmodel (#1027)")
Use the execnet main_thread_only execmodel so that code which expects
to run in the main thread will just work. This execmodel has been
merged to the execnet master branch via pytest-dev/execnet#243, so this
patch should not be merged until there is a released version of execnet
supporting the main_thread_only execmodel.
Closes#620
These days dicts are guaranteed to be ordered, so no need to use
OrderedDict in two of the three cases (the remaining case needs
`popitem(last=False)`).
Since d153e0a4c4 the remote doesn't send
events for this hook at all (I think perhaps wrongly, but it's history
by now), so no point in handling it in the coordinator side.
The setuptools implementation of editable installs will insert a
placeholder entry into sys.path as part of its magic to register its
custom import mechanism.
These are not real filesystem paths and as such should not be
rewritten to absolute paths.
Currently, a reason to terminate early (e.g. test failure with --exitfail
option set) causes DSession to immediately raise an Interrupt exception.
Subsequent reports generated by the workers, during the shutdown phase, are
discarded.
One consequence is that, for the failing test, teardown and testfinish are
ignored, which prevents corresponding hooks pytest_runtest_logreport and
pytest_runtest_logfinish being executed for the failing test (this problem
covered in #54). The reporting of tests executing in other workers is also left in an
indeterminate state. This can affect other plugin code.
This is a relatively simple fix, which appears to have minimal and, I think,
acceptable impact on text execution behaviour.
The observable differences are differences in what is reported about a test
run. For example, when running, for example with the '-x/--exitfail' option, it
is possible that more than a single test failure is reported. This is because
more than one test did fail before the test run was completely stopped. The
reporting is absolutely correct; and complete. Prior to this change, only a
single failure would have been reported, but because of incomplete and arguably
incorrect reporting.
Hopefully this fixes#907, as seems this is the only
change in #901 which is somehow related.
---------
Co-authored-by: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
Maximum number of tests scheduled in one step.
Setting it to 1 will force pytest to send tests to workers one by one -
might be useful for a small number of slow tests.
Larger numbers will allow the scheduler to submit consecutive chunks of tests
to workers - allows reusing fixtures.
Unlimited if not set.
Fixes#855Fixes#255
* drop empty setup.py which "breaks" on incomplete build envs
* use the build package to build the dist
* update the gh workflow to use it
fixup noise from pre-commit
* Get `-nauto` default from `PYTEST_XDIST_AUTO_NUM_WORKERS`
A few additional tests for existing functionality are added too.
And the ``-n logical`` option is documented.
Fixes: https://github.com/pytest-dev/pytest-xdist/issues/792