GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_venv failure output is inscrutable · Issue #93957 · python/cpython

test_venv failure output is inscrutable #93957

New issue
Copy link
New issue
Copy link
Closed
Closed
test_venv failure output is inscrutable#93957
Copy link

Description

@jaraco
jaraco
opened on Jun 17, 2022
Issue body actions

With this Dockerfile, I can confirm the proposed fix in Setuptools has the desired effect:

FROM jaraco/multipy-tox

RUN apt install -y libarchive-tools
RUN apt install -y build-essential gdb lcov pkg-config libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
RUN wget -O - https://github.com/python/cpython/archive/refs/heads/3.9.zip | bsdtar -xf -
WORKDIR cpython-3.9
RUN sh ./configure --prefix /opt/python
RUN make install
RUN chmod u+x /opt/python/lib/python3.9/test/ziptestdata/exe_with_*
WORKDIR /
RUN /opt/python/bin/python3 -m pip install --upgrade pip
RUN /opt/python/bin/python3 -m pip install git+https://github.com/pypa/setuptools@bugfix/3383-cpython-sensitive-tests
CMD /opt/python/bin/python3 -m test

...

Unfortunately, it also creates its own regression in test_venv:

$ docker run -it -v /Users/jaraco/p/pypa/setuptools:/src @$(docker build -q .) /opt/python/bin/py
thon3 -m test test_venv
0:00:00 load avg: 0.04 Run tests sequentially
0:00:00 load avg: 0.04 [1/1] test_venv
test test_venv failed -- Traceback (most recent call last):
  File "/opt/python/lib/python3.9/test/test_venv.py", line 544, in test_with_pip
    self.do_test_with_pip(True)
  File "/opt/python/lib/python3.9/test/test_venv.py", line 511, in do_test_with_pip
    out, err = check_output([envpy,
  File "/opt/python/lib/python3.9/test/test_venv.py", line 44, in check_output
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command '['/tmp/tmpqts0cln1/bin/python3', '-W', 'ignore::DeprecationWarning', '-I', '-m', 'ensurepip._uninstall']' returned non-zero exit status 1.

test_venv failed (1 error)

== Tests result: FAILURE ==

1 test failed:
    test_venv

Total duration: 5.7 sec
Tests result: FAILURE

And annoyingly, that error message is all but worthless for diagnosis.

Originally posted by @jaraco in #91169 (comment)

Activity

  1. jaraco commented on Jun 17, 2022

    @jaraco
    jaraco
    on Jun 17, 2022
    MemberAuthor
    More actions

    Exploring this initially, it seems someone had a similar issue earlier in the test, where they've wrapped run_with_capture with a try/except block to provide more detail if an error occurs, but they didn't do this for the _uninstall operation.

  2. jaraco commented on Jun 17, 2022

    @jaraco
    jaraco
    on Jun 17, 2022
    MemberAuthor
    More actions

    I note that even though the code above captures the "output", it only looks at "exc.output" and not "exc.stderr", which would be necessary for some errors.

  3. jaraco
    added 2 commits that reference this issue on Jun 17, 2022

    gh-93957: Provide nicer error reporting from subprocesses in test_ven…

    7b3af02

    gh-93957: Provide nicer error reporting from subprocesses in test_ven…

    7a9e761
  4. miss-islington
    added a commit that references this issue on Jun 18, 2022

    gh-93975: Nicer error reporting in test_venv (GH-93959)

    6066f45
  5. jaraco
    added 3 commits that reference this issue on Jun 19, 2022

    [3.11] gh-93975: Nicer error reporting in test_venv (GH-93959)

    ff79876

    [3.10] gh-93975: Nicer error reporting in test_venv (GH-93959)

    dd4016e

    [3.9] gh-93975: Nicer error reporting in test_venv (GH-93959)

    3f5b7ac
  6. serhiy-storchaka
    added a commit that references this issue on Jun 26, 2022

    Revert 30935 defer bpo45162 to 312 (#94285)

    1ffde3e
  7. hauntsaninja commented on Jul 6, 2022

    @hauntsaninja
    hauntsaninja
    on Jul 6, 2022
    Contributor
    More actions

    Closing, since #93959 and backports are merged

    Reacted by Jason R. Coombs
  8. hauntsaninja
    closed this as completedon Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.