DEP8 failure due to stderr output

Bug #1984135 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pytest (Ubuntu)
Fix Released
Undecided
Andreas Hasenack

Bug Description

pytest 7.1.2 is failing migration because its test now produces stderr output. Specifically, this comes from the "lsof -v" command it runs to check if lsof is available:
autopkgtest [14:33:03]: test unittests-3: [-----------------------
lsof version information:
    revision: 4.95.0
    latest revision: https://github.com/lsof-org/lsof
    latest FAQ: https://github.com/lsof-org/lsof/blob/master/00FAQ
    latest (non-formatted) man page: https://github.com/lsof-org/lsof/blob/master/Lsof.8
    compiler: cc
    compiler version: 11.3.0 (Ubuntu 11.3.0-1ubuntu1)
    compiler flags: -g -O2 -ffile-prefix-map=/build/lsof-UeRTyP/lsof-4.95.0=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DLINUXV=515035 -DGLIBCV=235 -DHASIPv6 -DNEEDS_NETINET_TCPH -DHASSELINUX -DHASUXSOCKEPT -DHASPTYEPT -DHASSOSTATE -DHASSOOPT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_STRFTIME -DLSOF_VSTR="5.15.35" -I/usr/include/tirpc -O
    loader flags: -L./lib -llsof -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -ltirpc -lselinux
    Anyone can list all files.
    /dev warnings are disabled.
    Kernel ID check is disabled.

...
==== 2908 passed, 68 skipped, 4 deselected, 9 xfailed in 202.43s (0:03:22) =====
autopkgtest [14:36:26]: test unittests-3: -----------------------]
autopkgtest [14:36:26]: test unittests-3: - - - - - - - - - - results - - - - - - - - - -
unittests-3 FAIL stderr: lsof version information:
autopkgtest [14:36:27]: test unittests-3: - - - - - - - - - - stderr - - - - - - - - -

It's unclear why this started happening just now. "lsof -v" didn't change behavior, the allow-stderr flag was not in d/t/control in previous releases, and we can even see the "lsof -v" output in previous test runs that succeeded.

We can either add the allow-stderr flag to d/t/control, at the risk of relaxing the test a bit, or patch pytest to send "lsof -v" to stdout instead, like this:

- subprocess.run(("lsof", "-v"), check=True)
+ subprocess.run(("lsof", "-v"), stderr=subprocess.STDOUT, check=True)

In debian this isn't failing because lsof is not installed, and since it's not listed as a dependency in d/t/control, the lsof check is just never run, and thus we don't have stderr output.

description: updated
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

File descriptor leaks are also sent to stderr:

unittests-3 FAIL stderr: testing/test_assertion.py:1456: PytestWarning: ***** 6 FD leakage detected

Upstream is treating file descriptor leaks as warnings instead of errors since https://github.com/nicoddemus/pytest/commit/d9a2e70155a85e769d32a1e1fbe7e655203e9575

So let's allow stderr

Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Changed in pytest (Ubuntu):
status: New → In Progress
assignee: nobody → Andreas Hasenack (ahasenack)
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This was uploaded and is currently in kinetic-proposed.

Changed in pytest (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pytest - 7.1.2-2ubuntu1

---------------
pytest (7.1.2-2ubuntu1) kinetic; urgency=medium

  * d/t/control: also depend on lsof, used in the unittests-3 tests
  * d/t/control: Add allow-stderr restriction, since upstream treats
    lsof errors as warnings and not failures (LP: #1984135)

 -- Andreas Hasenack <email address hidden> Wed, 10 Aug 2022 10:55:59 -0300

Changed in pytest (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.