Skip to content

pytest + xdist not playing well (INTERNALLERROR) #15

Closed

Description

@pytestbot

Originally reported by: Alfredo Deza (BitBucket: alfredodeza, GitHub: alfredodeza)


Hi, I am trying to use pytest-xdist with the latest pytest (2.0.1dev5) and getting a huge INTERNALERROR traceback.

These are the versions I have currently installed:

  • py 1.4.0
  • pytest 2.0.1.dev5
  • pytest-xdist 1.6.dev2
  • execnet 1.0.9

The complete traceback from running py.test -n2

========================================================= test session starts =========================================================
platform darwin -- Python 2.6.1 -- pytest-2.0.1.dev5
gw0 IINTERNALERROR> config = <_pytest.config.Config object at 0x1032fefd0>
INTERNALERROR> 
INTERNALERROR>     def pytest_cmdline_main(config):
INTERNALERROR>         """ default command line protocol for initialization, session,
INTERNALERROR>         running tests and reporting. """
INTERNALERROR>         session = Session(config)
INTERNALERROR>         session.exitstatus = EXIT_OK
INTERNALERROR>         try:
INTERNALERROR>             config.pluginmanager.do_configure(config)
INTERNALERROR> >           config.hook.pytest_sessionstart(session=session)
INTERNALERROR> 
INTERNALERROR> config     = <_pytest.config.Config object at 0x1032fefd0>
INTERNALERROR> session    = <Session 'quid'>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/_pytest/main.py:63: 
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> 
INTERNALERROR> self = <HookCaller 'pytest_sessionstart'>
INTERNALERROR> 
INTERNALERROR>     def __call__(self, **kwargs):
INTERNALERROR>         methods = self.hookrelay._pm.listattr(self.name)
INTERNALERROR> >       return self._docall(methods, kwargs)
INTERNALERROR> 
INTERNALERROR> kwargs     = {'session': <Session 'quid'>}
INTERNALERROR> methods    = [<bound method DSession.pytest_sessionstart of <xdist.dsession.DSession instance at 0x10395b440>>, <bound method TerminalReporter.pytest_sessionstart of <_pytest.terminal.TerminalReporter instance at 0x103868dd0>>]
INTERNALERROR> self       = <HookCaller 'pytest_sessionstart'>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/_pytest/core.py:390: 
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> 
INTERNALERROR> self = <HookCaller 'pytest_sessionstart'>
INTERNALERROR> methods = [<bound method DSession.pytest_sessionstart of <xdist.dsession.DSession instance at 0x10395b440>>, <bound method TerminalReporter.pytest_sessionstart of <_pytest.terminal.TerminalReporter instance at 0x103868dd0>>]
INTERNALERROR> kwargs = {'session': <Session 'quid'>}
INTERNALERROR> 
INTERNALERROR>     def _docall(self, methods, kwargs):
INTERNALERROR>         self.trace(self.name, kwargs)
INTERNALERROR>         self.trace.root.indent += 1
INTERNALERROR>         mc = MultiCall(methods, kwargs, firstresult=self.firstresult)
INTERNALERROR>         try:
INTERNALERROR> >           res = mc.execute()
INTERNALERROR> 
INTERNALERROR> kwargs     = {'session': <Session 'quid'>}
INTERNALERROR> mc         = <MultiCall 0 results, 0 meths, kwargs={'session': <Session 'quid'>}>
INTERNALERROR> methods    = [<bound method DSession.pytest_sessionstart of <xdist.dsession.DSession instance at 0x10395b440>>, <bound method TerminalReporter.pytest_sessionstart of <_pytest.terminal.TerminalReporter instance at 0x103868dd0>>]
INTERNALERROR> self       = <HookCaller 'pytest_sessionstart'>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/_pytest/core.py:401: 
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> 
INTERNALERROR> self = <MultiCall 0 results, 0 meths, kwargs={'session': <Session 'quid'>}>
INTERNALERROR> 
INTERNALERROR>     def execute(self):
INTERNALERROR>         while self.methods:
INTERNALERROR>             method = self.methods.pop()
INTERNALERROR>             kwargs = self.getkwargs(method)
INTERNALERROR> >           res = method(**kwargs)
INTERNALERROR> 
INTERNALERROR> kwargs     = {'session': <Session 'quid'>}
INTERNALERROR> method     = <bound method DSession.pytest_sessionstart of <xdist.dsession.DSession instance at 0x10395b440>>
INTERNALERROR> res        = None
INTERNALERROR> self       = <MultiCall 0 results, 0 meths, kwargs={'session': <Session 'quid'>}>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/_pytest/core.py:322: 
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> 
INTERNALERROR> self = <xdist.dsession.DSession instance at 0x10395b440>, session = <Session 'quid'>
INTERNALERROR> 
INTERNALERROR>     @pytest.mark.trylast
INTERNALERROR>     def pytest_sessionstart(self, session):
INTERNALERROR>         self.nodemanager = NodeManager(self.config)
INTERNALERROR> >       self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR> 
INTERNALERROR> self       = <xdist.dsession.DSession instance at 0x10395b440>
INTERNALERROR> session    = <Session 'quid'>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/xdist/dsession.py:180: 
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> 
INTERNALERROR> self = <xdist.slavemanage.NodeManager object at 0x1039cee50>
INTERNALERROR> putevent = <bound method Queue.put of <Queue.Queue instance at 0x103959908>>
INTERNALERROR> 
INTERNALERROR>     def setup_nodes(self, putevent):
INTERNALERROR> >       self.makegateways()
INTERNALERROR> 
INTERNALERROR> putevent   = <bound method Queue.put of <Queue.Queue instance at 0x103959908>>
INTERNALERROR> self       = <xdist.slavemanage.NodeManager object at 0x1039cee50>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/xdist/slavemanage.py:50: 
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> 
INTERNALERROR> self = <xdist.slavemanage.NodeManager object at 0x1039cee50>
INTERNALERROR> 
INTERNALERROR>     def makegateways(self):
INTERNALERROR>         assert not list(self.group)
INTERNALERROR>         self.config.hook.pytest_xdist_setupnodes(config=self.config,
INTERNALERROR>             specs=self.specs)
INTERNALERROR>         for spec in self.specs:
INTERNALERROR> >           gw = self.group.makegateway(spec)
INTERNALERROR> 
INTERNALERROR> self       = <xdist.slavemanage.NodeManager object at 0x1039cee50>
INTERNALERROR> spec       = <XSpec '1'>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/xdist/slavemanage.py:46: 
INTERNALERROR> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
INTERNALERROR> 
INTERNALERROR> self = <Group []>, spec = <XSpec '1'>
INTERNALERROR> 
INTERNALERROR>     def makegateway(self, spec=None):
INTERNALERROR>         """create and configure a gateway to a Python interpreter.
INTERNALERROR>             The ``spec`` string encodes the target gateway type
INTERNALERROR>             and configuration information. The general format is::
INTERNALERROR>     
INTERNALERROR>                 key1=value1//key2=value2//...
INTERNALERROR>     
INTERNALERROR>             If you leave out the ``=value`` part a True value is assumed.
INTERNALERROR>             Valid types: ``popen``, ``ssh=hostname``, ``socket=host:port``.
INTERNALERROR>             Valid configuration::
INTERNALERROR>     
INTERNALERROR>                 id=<string>     specifies the gateway id
INTERNALERROR>                 python=<path>   specifies which python interpreter to execute
INTERNALERROR>                 chdir=<path>    specifies to which directory to change
INTERNALERROR>                 nice=<path>     specifies process priority of new process
INTERNALERROR>                 env:NAME=value  specifies a remote environment variable setting.
INTERNALERROR>     
INTERNALERROR>             If no spec is given, self.defaultspec is used.
INTERNALERROR>             """
INTERNALERROR>         if not spec:
INTERNALERROR>             spec = self.defaultspec
INTERNALERROR>         if not isinstance(spec, XSpec):
INTERNALERROR>             spec = XSpec(spec)
INTERNALERROR>         self.allocate_id(spec)
INTERNALERROR>         if spec.popen:
INTERNALERROR>             gw = gateway.PopenGateway(python=spec.python, id=spec.id)
INTERNALERROR>         elif spec.ssh:
INTERNALERROR>             gw = gateway.SshGateway(spec.ssh, remotepython=spec.python,
INTERNALERROR>                                     ssh_config=spec.ssh_config, id=spec.id)
INTERNALERROR>         elif spec.socket:
INTERNALERROR>             assert not spec.python, (
INTERNALERROR>                 "socket: specifying python executables not yet supported")
INTERNALERROR>             from execnet.gateway_socket import SocketGateway
INTERNALERROR>             gateway_id = spec.installvia
INTERNALERROR>             if gateway_id:
INTERNALERROR>                 viagw = self[gateway_id]
INTERNALERROR>                 gw = SocketGateway.new_remote(viagw, id=spec.id)
INTERNALERROR>             else:
INTERNALERROR>                 host, port = spec.socket.split(":")
INTERNALERROR>                 gw = SocketGateway(host, port, id=spec.id)
INTERNALERROR>         else:
INTERNALERROR> >           raise ValueError("no gateway type found for %r" % (spec._spec,))
INTERNALERROR> E           ValueError: no gateway type found for '1'
INTERNALERROR> 
INTERNALERROR> self       = <Group []>
INTERNALERROR> spec       = <XSpec '1'>
INTERNALERROR> 
INTERNALERROR> ../../quidenv/lib/python2.6/site-packages/execnet/multi.py:94: ValueError

==========================================================  in 0.11 seconds ==================

Activity

  1. pytestbot commented on Jan 12, 2011

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    hum, this looks odd. very odd. Does this happen in an empty directory already?

    And can you attach the complete output of a "py.test --traceconfig -n2" run?

  2. pytestbot commented on Jan 28, 2011

    @pytestbot
    ContributorAuthor

    Original comment by Alfredo Deza (BitBucket: alfredodeza, GitHub: alfredodeza):


    This happens regardless of the contents of the directory.

    It also works perfectly fine if I trash the virtualenv and use pytest2.0.0 :(

    It has been a while since I was last doing work in that corner... so give me some time while I get back at it to do a full --traceconfig

  3. pytestbot commented on Feb 25, 2011

    @pytestbot
    ContributorAuthor

    Original comment by Alfredo Deza (BitBucket: alfredodeza, GitHub: alfredodeza):


    I am closing this bug since I haven't been able to replicate.

    I am guessing that somehow the latest py.test version fixes some of this.

    If I get into it again I will submit a new bug report.

  4. added a commit that references this issue on Oct 27, 2018
    5370714
  5. added a commit that references this issue on Oct 30, 2019
  6. added a commit that references this issue on May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions