Why hang tox if i run the setup?

I use locally tox, but it hangs if i run tox -r -vvv.

My tox.ini

[tox]
envlist =
    py37-lint,
    black-check,
    py{37}-Plone{60},
#    docs,
#    coverage-report,

skip_missing_interpreters = True


[gh-actions]
python =
    3.7: py37


[gh-actions:env]
PLONE-VERSION =
    Plone60: Plone60


[testenv]
skip_install = true

extras =
    develop
    test

commands =
    {envbindir}/buildout -vvv -N -t 3 -c {toxinidir}/{env:version_file} buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
    {envbindir}/buildout -vvv -N -t 3 -c {toxinidir}/{env:version_file} buildout:directory={envdir} buildout:develop={toxinidir} annotate
    {envbindir}/buildout -vvv -N -t 3 -c {toxinidir}/{env:version_file} buildout:directory={envdir} buildout:develop={toxinidir} install test robot
    coverage run {envbindir}/test -v1 --auto-color {posargs}
    # coverage run {envbindir}/test -v --all -t robot {posargs}

setenv =
    COVERAGE_FILE=.coverage.{envname}
    # version_file=test_plone60.cfg
    Plone60: version_file=test_plone60.cfg

deps =
    Plone60: -rrequirements_plone60.txt
    Plone60: -cconstraints_plone60.txt
    coverage


[testenv:coverage-report]
skip_install = true
usedevelop = True
basepython = python3.7

deps =
    coverage
    -cconstraints_plone60.txt

setenv =
    COVERAGE_FILE=.coverage

commands =
    coverage erase
    coverage combine
    coverage html
    coverage xml
    coverage report


[lint]
skip_install = true

deps =
    -cconstraints.txt
    isort
    flake8
    # helper to generate HTML reports:
    flake8-html
    # Useful flake8 plugins that are Python and Plone specific:
    flake8-coding
    flake8-debugger
    flake8-deprecated
    flake8-print
    #flake8-pytest
    flake8-todo
    mccabe
    # Potential flake8 plugins that should be used:  # TBD
    #flake8-blind-except
    #flake8-commas
    #flake8-docstrings
    #flake8-mypy
    #flake8-pep3101
    #flake8-plone-hasattr
    #flake8-string-format
    #flake8_strict
    #flake8-quotes
    #flake8-polyfill

commands =
    mkdir -p {toxinidir}/reports/flake8
    - flake8 --format=html --htmldir={toxinidir}/reports/flake8 --doctests {toxinidir}/src {toxinidir}/setup.py
    flake8 --doctests {toxinidir}/src {toxinidir}/setup.py
    isort --check-only {toxinidir}/src {toxinidir}/setup.py
    # black --check --diff -v {toxinidir}/src {toxinidir}/setup.py

whitelist_externals =
    mkdir


[testenv:isort-apply]
skip_install = true

deps =
    -cconstraints.txt
    isort

commands =
    isort {toxinidir}/src {toxinidir}/setup.py --settings-path setup.cfg .


[testenv:black-check]
basepython = python3.7
skip_install = True
deps =
    -cconstraints.txt
    black

commands =
    black --check --diff -v src setup.py


[testenv:black-enforce]
basepython = python3.7
skip_install = True
deps =
    -cconstraints.txt
    black

commands =
    black -v src setup.py


[testenv:py37-lint]
basepython = python3.7
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}

[testenv:docs]
skip_install = true

deps =
    Sphinx

commands =
    sphinx-build -b html -d _build/docs/doctrees docs _build/docs/html

It hangs after the first command:

/opt/dev/my.addon/.tox/py37-Plone60/bin/buildout -vvv -N -t 3 -c /opt/dev/my.addon/test_plone60.cfg buildout:directory=/opt/dev/my.addon/.tox/py37-Plone60 buildout:develop=/opt/dev/my.addon bootstrap

But if i call the commands as single commands in my console than all is fine and the test are running.

../my.addon$ /opt/dev/my.addon/.tox/py37-Plone60/bin/buildout -vvv -N -t 3 -c /opt/dev/my.addon/test_plone60.cfg buildout:directory=/opt/dev/my.addon/.tox/py37-Plone60 buildout:develop=/opt/dev/my.addon bootstrap
../my.addon$ /opt/dev/my.addon/.tox/py37-Plone60/bin/buildout -vvv -N -t 3 -c /opt/dev/my.addon/test_plone60.cfg buildout:directory=/opt/dev/my.addon/.tox/py37-Plone60 buildout:develop=/opt/dev/my.addon annotate
../my.addon$ /opt/dev/my.addon/.tox/py37-Plone60/bin/buildout -vvv -N -t 3 -c /opt/dev/my.addon/test_plone60.cfg buildout:directory=/opt/dev/my.addon/.tox/py37-Plone60 buildout:develop=/opt/dev/my.addon install test robot

Had anyone a hint for me for debugging the situation?

Wild guess - do your commands rely on environment variables? tox only passes in a couple of necessary variables and blocks all, except you allow them with passenv.

You could add a passenv=* and see if that changes something and then try to figure out which variable is missing.

Other than that. Did your tox setup ever work? Did you change something?

is it really working when doing it the command line?

The most problematic part is the folder you are in, when starting the script. So how the env variables get evaluated.

Please go into the "toxenvdir" and try again there to run the command. Than you see the base Problem.

My wild guess is that the relative referenced cfg files in your buildout are not found.

@loechel Yes this was the Problem, thanks!

[buildout]
# test_plone60.cfg
extends =
    https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-6.0.x.cfg
    https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
    base.cfg

If i copy the base.cfg to {envdir} bin/tox run without Problems. Is there a way to tell tox where the base.cfg lives? For example i set the buildout option for the download-egg-cache via buildout:download-cache={toxinidir}/../download-cache

Well you actualy doing this with:

buildout:directory={envdir}

if you would like to have the expected behavoiur it must be:

buildout:directory={toxinidir}

but than you have the problem, that you cant let tox run in paralell mode.

And you probably should have a cleanup step that deletes ./parts ./vars in the {toxinidir}

@1letter are you aware of ~/.buildout/default.cfg settings?

you could actually set eggs-directory, download-cache and extentds-cahce there for your user, so that you do not need that in the specific buildout

i will test this option, i didn't know that this is possible.

Creating a buildout defaults file — Plone Documentation v4.3 and Staying DRY with value substitutions, extending, and macros — Buildout 2.7 documentation are some Documentation about that.

it was a network problem, the download off the eggs hangs. after many many restarts an a full download cache of eggs, all run fine.