pytest-dev / py

Python development support library (note: maintenance only)
MIT License
67 stars 106 forks source link

TestSvnWCAuthFunctional.test_switch fails when executing under xdist #160

Closed nicoddemus closed 1 year ago

nicoddemus commented 6 years ago

Travis log:

_____________________ TestSvnWCAuthFunctional.test_switch ______________________
[gw1] linux2 -- Python 2.7.13 /home/travis/virtualenv/python2.7.13/bin/python
self = <test_svnauth.TestSvnWCAuthFunctional instance at 0x7f57934e6518>
setup = <test_svnauth.Setup instance at 0x7f5792eeb248>
    def test_switch(self, setup):
        wc = py.path.svnwc(setup.temppath, auth=setup.auth)
        svnurl = 'svn://localhost:%s/%s' % (setup.port, setup.repopath.basename)
        wc.checkout(svnurl)
        wc.ensure('foo', dir=True).ensure('foo.txt').write('foo')
        wc.commit('added foo dir with foo.txt file')
        wc.ensure('bar', dir=True)
        wc.commit('added bar dir')
        bar = wc.join('bar')
>       bar.switch(svnurl + '/foo')
testing/path/test_svnauth.py:334: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
py/_path/svnwc.py:499: in switch
    self._authsvn('switch', [url])
py/_path/svnwc.py:462: in _authsvn
    return self._svn(cmd, *args)
py/_path/svnwc.py:476: in _svn
    out = py.process.cmdexec(string)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cmd = 'LC_ALL=C svn switch svn://localhost:10000/repo/foo --username="johnny" --password="foo" --no-auth-cache --non-interactive "/tmp/pytest-of-travis/pytest-0/popen-gw1/test_switch0/temppath/bar"'
    def cmdexec(cmd):
        """ return unicode output of executing 'cmd' in a separate process.

        raise cmdexec.Error exeception if the command failed.
        the exception will provide an 'err' attribute containing
        the error-output from the command.
        if the subprocess module does not provide a proper encoding/unicode strings
        sys.getdefaultencoding() will be used, if that does not exist, 'UTF-8'.
        """
        process = subprocess.Popen(cmd, shell=True,
                universal_newlines=True,
                stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        out, err = process.communicate()
        if sys.version_info[0] < 3: # on py3 we get unicode strings, on py2 not
            try:
                default_encoding = sys.getdefaultencoding() # jython may not have it
            except AttributeError:
                default_encoding = sys.stdout.encoding or 'UTF-8'
            out = unicode(out, process.stdout.encoding or default_encoding)
            err = unicode(err, process.stderr.encoding or default_encoding)
        status = process.poll()
        if status:
>           raise ExecutionFailed(status, status, cmd, out, err)
E           Error: ExecutionFailed: 1  LC_ALL=C svn switch svn://localhost:10000/repo/foo --username="johnny" --password="foo" --no-auth-cache --non-interactive "/tmp/pytest-of-travis/pytest-0/popen-gw1/test_switch0/temppath/bar"
E           svn: E195012: Path '/tmp/pytest-of-travis/pytest-0/popen-gw1/test_switch0/temppath/bar' does not share common version control ancestry with the requested switch location.  Use --ignore-ancestry to disable this check.
E           svn: E195012: 'svn://localhost:10000/repo/foo' shares no common ancestry with '/tmp/pytest-of-travis/pytest-0/popen-gw1/test_switch0/temppath/bar'
py/_process/cmdexec.py:28: Error
---------------------------- Captured stdout setup -----------------------------
svnserve -d -T --listen-port=10000 --pid-file=/tmp/pytest-of-travis/pytest-0/popen-gw1/test_switch0/pid -r /tmp/pytest-of-travis/pytest-0/popen-gw1/test_switch0