When detox creates or recreates a virtualenv, it leaves it in a state where both tox and detox think the virtualenv isn't created at all, so the next run of tox/detox will create it again, wasting time.
See https://gist.github.com/mgedmin/915b5e797c42f622225e for steps to reproduce with full output examples.
@mgedmin thanks for you detailed reoprt. I converted your gist and put it here. It would be interesting to know if this problem still persists. Could you confirm or deny this?
Version information :
$ detox --version
2.1.1 imported from /home/mg/.venv/local/lib/python2.7/site-packages/tox/__init__.pyc
$ tox --version
2.1.1 imported from /home/mg/.venv/local/lib/python2.7/site-packages/tox/__init__.pyc
$ pip list | grep tox
detox (0.10.0)
tox (2.1.1)
Steps to reproduce:
Create a tox.ini:
[tox]
envlist = py27,py34
skipsdist = true
[testenv]
deps =
mock
commands =
Run detox :
$ detox
py27 create: /home/mg/src/bugs/detox-bug/.tox/py27
py34 create: /home/mg/src/bugs/detox-bug/.tox/py34
py27 installdeps: mock
py34 installdeps: mock
py27 runtests: PYTHONHASHSEED='1700383350'
py34 runtests: PYTHONHASHSEED='1700383350'
________________________ summary ________________________
py27: commands succeeded
py34: commands succeeded
congratulations :)
Run detox again.
Expected behavior:
$ detox
py27 runtests: PYTHONHASHSEED='3485389327'
py34 runtests: PYTHONHASHSEED='3485389327'
________________________ summary ________________________
py27: commands succeeded
py34: commands succeeded
congratulations :)
Actual behavior:
$ detox
py27 create: /home/mg/src/bugs/detox-bug/.tox/py27
py34 create: /home/mg/src/bugs/detox-bug/.tox/py34
py27 installdeps: mock
py34 installdeps: mock
py34 runtests: PYTHONHASHSEED='2836152123'
py27 runtests: PYTHONHASHSEED='2836152123'
________________________ summary ________________________
py27: commands succeeded
py34: commands succeeded
congratulations :)
Interesting observations:
run tox, then run detox again:
$ tox
py27 create: /home/mg/src/bugs/detox-bug/.tox/py27
py27 installdeps: mock
py27 installed: funcsigs==0.4,mock==1.3.0,pbr==1.8.1,six==1.10.0,wheel==0.24.0
py27 runtests: PYTHONHASHSEED='2247925867'
py34 create: /home/mg/src/bugs/detox-bug/.tox/py34
py34 installdeps: mock
py34 installed: mock==1.3.0,pbr==1.8.1,six==1.10.0,wheel==0.24.0
py34 runtests: PYTHONHASHSEED='2247925867'
________________________ summary ________________________
py27: commands succeeded
py34: commands succeeded
congratulations :)
$ detox
py27 runtests: PYTHONHASHSEED='3552145827'
py34 runtests: PYTHONHASHSEED='3552145827'
________________________ summary ________________________
py27: commands succeeded
py34: commands succeeded
congratulations :)
$ detox
py27 runtests: PYTHONHASHSEED='1363150801'
py34 runtests: PYTHONHASHSEED='1363150801'
________________________ summary ________________________
py27: commands succeeded
py34: commands succeeded
congratulations :)
The problem persists -- I tested detox 0.10.0 and tox version 2.6.0.
+1 on this. I recently ran into it in my project, which increased the runtime pretty painfully. From what I could tell it was just not wrapping up the virtual environment correctly, which I fix in https://github.com/tox-dev/detox/pull/9.
fixed with https://github.com/tox-dev/detox/pull/9
released with detox 0.13
Most helpful comment
The problem persists -- I tested
detox0.10.0 andtoxversion 2.6.0.