-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pytest-xdist hangs if max-slave-restart is set and the restart limit is reached #45
Comments
I found time to take a look, its indeed 2 bugs, one in pytest that will require the upcoming 2.9 release (parameter passing) The other one in xdist being a deadlock condition that's scheduled for fixing of xdist 2.0 since it needs a extensive internal refactoring to address the issue propperly |
Thanks. Will look forward for new xdist and py.test then :) |
I am hitting this same issue. I get to trigger the problem when using Since the slave restart got into a loop (slave connects, conftest raises exception, slave restarts) I added the
Versions used: py.test 3.0.3 |
Maybe allowing a This is pretty bad for us because we are relying on this feature for (automated) CI test runs and we keep hitting this |
Thanks @alfredodeza. Just to comment that this issue has not been forgotten, it is just that we maintainers didn't yet have the time to look at it properly. If someone wants to try a PR we would appreciate it. |
Hi, Is there any updates on this issue? |
nope |
In case it helps, the problem seems to be that the while loop in The other thing I see is that forked processes that die don't seem to be collected properly: they hang around until the parent dies (which is the problem I have when infinite worker restarts are allowed: eventually no more processes can be created and the system locks up). |
This works for me, checking to see if there are any active nodes, although I'm sure there's a better way to force an exit rather than raising def loop_once(self):
"""Process one callback from one of the slaves."""
while 1:
if not self._active_nodes:
# If everything has died stop looping
self.triggershutdown()
raise RuntimeError("No active nodes")
try:
eventcall = self.queue.get(timeout=2.0)
break
except queue.Empty:
continue |
Did you try just returning from it after def loop_once(self):
"""Process one callback from one of the slaves."""
while 1:
if not self._active_nodes:
# If everything has died stop looping
self.triggershutdown()
return
try:
eventcall = self.queue.get(timeout=2.0)
break
except queue.Empty:
continue |
Yes. If you do that the process exits with "no tests found". I think it should more strongly indicate that things went wrong. |
Oh right. Hmm not sure then, perhaps @RonnyPfannschmidt has a suggestion in which exception should be thrown then? |
nope |
In that case I think raising an internal error is better than the alternative, which is to just loop forever. We can worry about providing a nicer message later. @timj would you like to open a PR with this fix? |
Fixed by #238 |
It can be observed in this build:
https://travis-ci.org/ClearcodeHQ/pytest-dbfixtures/jobs/108118580
I'm testing if a package is configured properly (all non py files are included, hence change to install) and installing the package with "pip install ." before the test.
pytest_load_initial_conftests
throws a ValidationError if the additional files can not be accessed. however I end up with a loop of restarting slaves indefinitely, or if I set--max-slave-restart
, I end up with hanging py.test as well.The text was updated successfully, but these errors were encountered: