Skip to content
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

detox creates virtualenvs repeatedly and unnecessarily #283

Closed
pytoxbot opened this issue Sep 17, 2016 · 5 comments

Comments

@pytoxbot
Copy link

commented Sep 17, 2016

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.

@obestwalter

This comment has been minimized.

Copy link
Member

commented Mar 10, 2017

@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?

detox creates environments unnecessarily

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:

  1. Create a tox.ini:

    [tox]
    envlist = py27,py34
    skipsdist = true
    
    [testenv]
    deps =
        mock
    commands =
    
  2. 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 :)
    
  3. 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 :)
    

@obestwalter obestwalter moved this from triage to needs discussion in Squash all the bugs Mar 10, 2017

@mgedmin

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2017

The problem persists -- I tested detox 0.10.0 and tox version 2.6.0.

@Epiphane

This comment has been minimized.

Copy link

commented Jan 10, 2018

+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 tox-dev/detox#9.

mgedmin added a commit to ProgrammersOfVilnius/pov-server-page that referenced this issue Jan 17, 2018

make coverage: avoid detox
Because tox-dev/tox#283 is annoying as heck.
@obestwalter

This comment has been minimized.

Copy link
Member

commented Aug 18, 2018

fixed with tox-dev/detox#9

@obestwalter

This comment has been minimized.

Copy link
Member

commented Aug 20, 2018

released with detox 0.13

@obestwalter obestwalter moved this from ready to released/wontfix in Squash all the bugs Oct 1, 2018

@obestwalter obestwalter moved this from todo to done in Cache invalidation problems Oct 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.