[TIP] Running tox on several jenkins jobs are the same time sometimes throws an error

Pedro Rodriguez vondiefinsternis at gmail.com
Mon Feb 18 11:50:29 PST 2013


I'm using Tox with Jenkins to run several selenium tests. Everything is
good but every now and then I get the follow error:

IOError: [Errno 2] No such file or directory: '/var/lib/jenkins/.tox/
jenkins/lib/python2.7/site-packages/Distutils-1.0-py2.7.egg-info'

Looking at the log (when it works), I think the issue is this:

Installing collected packages: Distutils

  Found existing installation: Distutils 1.0

    Uninstalling Distutils:

      Removing file or directory
/var/lib/jenkins/.tox/jenkins/lib/python2.7/site-packages/Distutils-1.0-py2.7.egg-info
      Successfully uninstalled Distutils

I think what is happening is that if 2 or more tox are running at the same
time, while one is Uninstalling Distutils, then another one tries to do the
same thing (and since the other one already did it, it can't find it and
throws an IO error).

So:
ToxA -> Finds the Distutils installation
ToxB -> Also finds it
ToxA -> Delete it
ToxB -> Try to delete (fails)

So my questions are:
- Why is Distutils being deleted? (noob when it comes to it)
- Is there a way to avoid this?
- How are you guys using Tox with Jenkins? I'm just calling tox -e jenkins
path/to/test.py. Is there a better way?
- sbt and other building tools usually have locking mechanisms for these
kind of things. Why doesn't Tox? (if it does, how do I turn it on?).

Thanks,
~Pedro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20130218/93404a8f/attachment.htm>


More information about the testing-in-python mailing list