Skip to content

Understanding an IOError #3145

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

Closed
P-EB opened this issue Jan 23, 2018 · 8 comments
Closed

Understanding an IOError #3145

P-EB opened this issue Jan 23, 2018 · 8 comments
Labels
type: question general question, might be closed after 2 weeks of inactivity

Comments

@P-EB
Copy link

P-EB commented Jan 23, 2018

Hi,

I'm packaging for debian some pytest extensions. I submitted a bug to pytest-httpbin (see here: kevin1024/pytest-httpbin#47), regarding some issues with their tests.

Yet, I'm also trying to understand what is going south by myself, and for now, I totally fail at it.

Here's an error I got recently while building the package:

=================================== FAILURES ===================================
______________________________ test_unicode_data _______________________________

self = <CallInfo when='call' exception: seek() called during concurrent operation on the same file object>
func = <function <lambda> at 0x7f81adc0df50>, when = 'call'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

/usr/lib/python2.7/dist-packages/_pytest/runner.py:196: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python2.7/dist-packages/_pytest/runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
/usr/lib/python2.7/dist-packages/_pytest/capture.py:139: in pytest_runtest_call
    self.suspendcapture_item(item, "call")
/usr/lib/python2.7/dist-packages/_pytest/capture.py:156: in suspendcapture_item
    out, err = self.suspendcapture(in_=in_)
/usr/lib/python2.7/dist-packages/_pytest/capture.py:97: in suspendcapture
    outerr = cap.readouterr()
/usr/lib/python2.7/dist-packages/_pytest/capture.py:327: in readouterr
    self.err.snap() if self.err is not None else "")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <FDCapture 2 oldfd=6>

    def snap(self):
        f = self.tmpfile
>       f.seek(0)
E       IOError: seek() called during concurrent operation on the same file object

/usr/lib/python2.7/dist-packages/_pytest/capture.py:375: IOError
--------------------------- Captured stderr teardown ---------------------------
127.0.0.1 - - [23/Jan/2018 16:13:00] "POST /post HTTP/1.1" 200 477

The full test log is here:


autopkgtest /home/peb/git/debian/pytest-httpbin/pytest-httpbin_0.3.0-1_amd64.changes -- schroot unstable-amd64-sbuild; aptexit=$?; if test $aptexit = 8 -o $aptexit = 12; then exit 0; else exit $aptexit; fi
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

autopkgtest [17:12:47]: version 4.4
autopkgtest [17:12:47]: host pimeys; command line: /usr/bin/autopkgtest /home/peb/git/debian/pytest-httpbin/pytest-httpbin_0.3.0-1_amd64.changes -- schroot unstable-amd64-sbuild
autopkgtest [17:12:47]: testbed dpkg architecture: amd64
autopkgtest [17:12:47]: testbed running kernel: Linux 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2 (2017-06-12)
autopkgtest [17:12:47]: @@@@@@@@@@@@@@@@@@@@ source /home/peb/git/debian/pytest-httpbin/pytest-httpbin_0.3.0-1.dsc
dpkg-source: warning: extracting unsigned source package (/tmp/autopkgtest.ge1fix/pytest-httpbin_0.3.0-1.dsc)
dpkg-source: info: extracting pytest-httpbin in pytest-httpbin-0.3.0
dpkg-source: info: unpacking pytest-httpbin_0.3.0.orig.tar.gz
dpkg-source: info: unpacking pytest-httpbin_0.3.0-1.debian.tar.xz
dpkg-source: info: applying 0001-Uses-context-manager-for-requests.Session.patch
autopkgtest [17:12:48]: testing package pytest-httpbin version 0.3.0-1
autopkgtest [17:12:48]: build not needed
autopkgtest [17:12:48]: test python-pytest-httpbin: preparing testbed
Get:1 file:/tmp/autopkgtest.ge1fix/binaries  InRelease
Ign:1 file:/tmp/autopkgtest.ge1fix/binaries  InRelease
Get:2 file:/tmp/autopkgtest.ge1fix/binaries  Release [816 B]
Get:2 file:/tmp/autopkgtest.ge1fix/binaries  Release [816 B]
Get:3 file:/tmp/autopkgtest.ge1fix/binaries  Release.gpg
Ign:3 file:/tmp/autopkgtest.ge1fix/binaries  Release.gpg
Get:4 file:/tmp/autopkgtest.ge1fix/binaries  Packages [2302 B]
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies...Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
 Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following additional packages will be installed:
  ca-certificates libexpat1 libjs-jquery libpython-stdlib libpython2.7-minimal
  libpython2.7-stdlib libssl1.1 mime-support openssl python python-all
  python-certifi python-chardet python-click python-colorama python-decorator
  python-flask python-gevent python-greenlet python-httpbin python-idna
  python-itsdangerous python-jinja2 python-markupsafe python-minimal
  python-pkg-resources python-py python-pytest python-pytest-httpbin
  python-requests python-six python-urllib3 python-werkzeug python2.7
  python2.7-minimal
Suggested packages:
  python-doc python-tk python-flask-doc python-gevent-doc python-gevent-dbg
  python-openssl python-greenlet-doc python-greenlet-dev python-greenlet-dbg
  python-jinja2-doc python-setuptools subversion python-pytest-xdist
  python-mock python-cryptography python-socks python-ntlm ipython
  python-genshi python-lxml python-redis python-pylibmc | python-memcache
  python-termcolor python-watchdog python-werkzeug-doc python2.7-doc
  binfmt-support
Recommended packages:
  javascript-common file python-blinker gunicorn python-simplejson
  python-cryptography python-ipaddress python-openssl python-pyinotify
The following NEW packages will be installed:
  ca-certificates libexpat1 libjs-jquery libpython-stdlib libpython2.7-minimal
  libpython2.7-stdlib libssl1.1 mime-support openssl python python-all
  python-certifi python-chardet python-click python-colorama python-decorator
  python-flask python-gevent python-greenlet python-httpbin python-idna
  python-itsdangerous python-jinja2 python-markupsafe python-minimal
  python-pkg-resources python-py python-pytest python-pytest-httpbin
  python-requests python-six python-urllib3 python-werkzeug python2.7
  python2.7-minimal
0 upgraded, 35 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 8608 kB/8623 kB of archives.
After this operation, 30.9 MB of additional disk space will be used.
Get:1 file:/tmp/autopkgtest.ge1fix/binaries  python-pytest-httpbin 0.3.0-1 [15.8 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 libpython2.7-minimal amd64 2.7.14-4 [393 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python2.7-minimal amd64 2.7.14-4 [1353 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-minimal amd64 2.7.14-4 [41.0 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 mime-support all 3.60 [36.7 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 libexpat1 amd64 2.2.5-3 [96.8 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 libssl1.1 amd64 1.1.0g-2 [1346 kB]
Get:8 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 libpython2.7-stdlib amd64 2.7.14-4 [1911 kB]
Get:9 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python2.7 amd64 2.7.14-4 [293 kB]
Get:10 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 libpython-stdlib amd64 2.7.14-4 [20.4 kB]
Get:11 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python amd64 2.7.14-4 [155 kB]
Get:12 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-pkg-resources all 38.2.4-2 [171 kB]
Get:13 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-py all 1.4.34-3 [83.5 kB]
Get:14 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-pytest all 3.2.1-2 [200 kB]
Get:15 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-decorator all 4.1.2-1 [13.7 kB]
Get:16 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-colorama all 0.3.7-1 [25.7 kB]
Get:17 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-click all 6.7-3 [56.5 kB]
Get:18 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-itsdangerous all 0.24+dfsg1-2 [13.0 kB]
Get:19 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-markupsafe amd64 1.0-1+b1 [13.9 kB]
Get:20 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-jinja2 all 2.10-1 [106 kB]
Get:21 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 libjs-jquery all 3.2.1-1 [154 kB]
Get:22 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-werkzeug all 0.14.1+dfsg1-1 [179 kB]
Get:23 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-flask all 0.12.2-2 [62.3 kB]
Get:24 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-greenlet amd64 0.4.12-2 [18.7 kB]
Get:25 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-gevent amd64 1.2.2-2 [402 kB]
Get:26 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-six all 1.11.0-1 [14.9 kB]
Get:27 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-httpbin all 0.5.0+dfsg-2 [81.1 kB]
Get:28 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-all amd64 2.7.14-4 [1020 B]
Get:29 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 openssl amd64 1.1.0g-2 [741 kB]
Get:30 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 ca-certificates all 20170717 [178 kB]
Get:31 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-certifi all 2017.11.5-1 [158 kB]
Get:32 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-chardet all 3.0.4-1 [80.2 kB]
Get:33 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-idna all 2.6-1 [34.1 kB]
Get:34 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-urllib3 all 1.22-1 [97.7 kB]
Get:35 http://cdn-fastly.deb.debian.org/debian unstable/main amd64 python-requests all 2.18.4-1 [77.2 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 8608 kB in 1s (6637 kB/s)
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 14854 files and directories currently installed.)
Preparing to unpack .../0-libpython2.7-minimal_2.7.14-4_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.14-4) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../1-python2.7-minimal_2.7.14-4_amd64.deb ...
Unpacking python2.7-minimal (2.7.14-4) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../2-python-minimal_2.7.14-4_amd64.deb ...
Unpacking python-minimal (2.7.14-4) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../3-mime-support_3.60_all.deb ...
Unpacking mime-support (3.60) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../4-libexpat1_2.2.5-3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.5-3) ...
Selecting previously unselected package libssl1.1:amd64.
Preparing to unpack .../5-libssl1.1_1.1.0g-2_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.0g-2) ...
Selecting previously unselected package libpython2.7-stdlib:amd64.
Preparing to unpack .../6-libpython2.7-stdlib_2.7.14-4_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.14-4) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../7-python2.7_2.7.14-4_amd64.deb ...
Unpacking python2.7 (2.7.14-4) ...
Selecting previously unselected package libpython-stdlib:amd64.
Preparing to unpack .../8-libpython-stdlib_2.7.14-4_amd64.deb ...
Unpacking libpython-stdlib:amd64 (2.7.14-4) ...
Setting up libpython2.7-minimal:amd64 (2.7.14-4) ...
Setting up python2.7-minimal (2.7.14-4) ...
Setting up python-minimal (2.7.14-4) ...
Selecting previously unselected package python.
(Reading database ... 15649 files and directories currently installed.)
Preparing to unpack .../00-python_2.7.14-4_amd64.deb ...
Unpacking python (2.7.14-4) ...
Selecting previously unselected package python-pkg-resources.
Preparing to unpack .../01-python-pkg-resources_38.2.4-2_all.deb ...
Unpacking python-pkg-resources (38.2.4-2) ...
Selecting previously unselected package python-py.
Preparing to unpack .../02-python-py_1.4.34-3_all.deb ...
Unpacking python-py (1.4.34-3) ...
Selecting previously unselected package python-pytest.
Preparing to unpack .../03-python-pytest_3.2.1-2_all.deb ...
Unpacking python-pytest (3.2.1-2) ...
Selecting previously unselected package python-decorator.
Preparing to unpack .../04-python-decorator_4.1.2-1_all.deb ...
Unpacking python-decorator (4.1.2-1) ...
Selecting previously unselected package python-colorama.
Preparing to unpack .../05-python-colorama_0.3.7-1_all.deb ...
Unpacking python-colorama (0.3.7-1) ...
Selecting previously unselected package python-click.
Preparing to unpack .../06-python-click_6.7-3_all.deb ...
Unpacking python-click (6.7-3) ...
Selecting previously unselected package python-itsdangerous.
Preparing to unpack .../07-python-itsdangerous_0.24+dfsg1-2_all.deb ...
Unpacking python-itsdangerous (0.24+dfsg1-2) ...
Selecting previously unselected package python-markupsafe.
Preparing to unpack .../08-python-markupsafe_1.0-1+b1_amd64.deb ...
Unpacking python-markupsafe (1.0-1+b1) ...
Selecting previously unselected package python-jinja2.
Preparing to unpack .../09-python-jinja2_2.10-1_all.deb ...
Unpacking python-jinja2 (2.10-1) ...
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../10-libjs-jquery_3.2.1-1_all.deb ...
Unpacking libjs-jquery (3.2.1-1) ...
Selecting previously unselected package python-werkzeug.
Preparing to unpack .../11-python-werkzeug_0.14.1+dfsg1-1_all.deb ...
Unpacking python-werkzeug (0.14.1+dfsg1-1) ...
Selecting previously unselected package python-flask.
Preparing to unpack .../12-python-flask_0.12.2-2_all.deb ...
Unpacking python-flask (0.12.2-2) ...
Selecting previously unselected package python-greenlet.
Preparing to unpack .../13-python-greenlet_0.4.12-2_amd64.deb ...
Unpacking python-greenlet (0.4.12-2) ...
Selecting previously unselected package python-gevent.
Preparing to unpack .../14-python-gevent_1.2.2-2_amd64.deb ...
Unpacking python-gevent (1.2.2-2) ...
Selecting previously unselected package python-six.
Preparing to unpack .../15-python-six_1.11.0-1_all.deb ...
Unpacking python-six (1.11.0-1) ...
Selecting previously unselected package python-httpbin.
Preparing to unpack .../16-python-httpbin_0.5.0+dfsg-2_all.deb ...
Unpacking python-httpbin (0.5.0+dfsg-2) ...
Selecting previously unselected package python-pytest-httpbin.
Preparing to unpack .../17-python-pytest-httpbin.deb ...
Unpacking python-pytest-httpbin (0.3.0-1) ...
Selecting previously unselected package python-all.
Preparing to unpack .../18-python-all_2.7.14-4_amd64.deb ...
Unpacking python-all (2.7.14-4) ...
Selecting previously unselected package openssl.
Preparing to unpack .../19-openssl_1.1.0g-2_amd64.deb ...
Unpacking openssl (1.1.0g-2) ...
Selecting previously unselected package ca-certificates.
Preparing to unpack .../20-ca-certificates_20170717_all.deb ...
Unpacking ca-certificates (20170717) ...
Selecting previously unselected package python-certifi.
Preparing to unpack .../21-python-certifi_2017.11.5-1_all.deb ...
Unpacking python-certifi (2017.11.5-1) ...
Selecting previously unselected package python-chardet.
Preparing to unpack .../22-python-chardet_3.0.4-1_all.deb ...
Unpacking python-chardet (3.0.4-1) ...
Selecting previously unselected package python-idna.
Preparing to unpack .../23-python-idna_2.6-1_all.deb ...
Unpacking python-idna (2.6-1) ...
Selecting previously unselected package python-urllib3.
Preparing to unpack .../24-python-urllib3_1.22-1_all.deb ...
Unpacking python-urllib3 (1.22-1) ...
Selecting previously unselected package python-requests.
Preparing to unpack .../25-python-requests_2.18.4-1_all.deb ...
Unpacking python-requests (2.18.4-1) ...
Setting up libjs-jquery (3.2.1-1) ...
Setting up libexpat1:amd64 (2.2.5-3) ...
Setting up mime-support (3.60) ...
Processing triggers for libc-bin (2.26-2) ...
Setting up libssl1.1:amd64 (1.1.0g-2) ...
Setting up openssl (1.1.0g-2) ...
Setting up ca-certificates (20170717) ...
Updating certificates in /etc/ssl/certs...
148 added, 0 removed; done.
Setting up libpython2.7-stdlib:amd64 (2.7.14-4) ...
Setting up python2.7 (2.7.14-4) ...
Setting up libpython-stdlib:amd64 (2.7.14-4) ...
Setting up python (2.7.14-4) ...
Setting up python-idna (2.6-1) ...
Setting up python-certifi (2017.11.5-1) ...
Setting up python-colorama (0.3.7-1) ...
Setting up python-pkg-resources (38.2.4-2) ...
Setting up python-markupsafe (1.0-1+b1) ...
Setting up python-werkzeug (0.14.1+dfsg1-1) ...
Setting up python-six (1.11.0-1) ...
Setting up python-greenlet (0.4.12-2) ...
Setting up python-decorator (4.1.2-1) ...
Setting up python-itsdangerous (0.24+dfsg1-2) ...
Setting up python-all (2.7.14-4) ...
Setting up python-urllib3 (1.22-1) ...
Setting up python-chardet (3.0.4-1) ...
Setting up python-gevent (1.2.2-2) ...
Setting up python-jinja2 (2.10-1) ...
Setting up python-click (6.7-3) ...
Setting up python-py (1.4.34-3) ...
Setting up python-pytest (3.2.1-2) ...
Setting up python-requests (2.18.4-1) ...
Setting up python-flask (0.12.2-2) ...
Setting up python-httpbin (0.5.0+dfsg-2) ...
Setting up python-pytest-httpbin (0.3.0-1) ...
Setting up autopkgtest-satdep (0) ...
Processing triggers for libc-bin (2.26-2) ...
Processing triggers for ca-certificates (20170717) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
(Reading database ... 16713 files and directories currently installed.)
Removing autopkgtest-satdep (0) ...
autopkgtest [17:13:00]: test python-pytest-httpbin: [-----------------------
[*] testing on python2.7:
pytest_httpbin/plugin.py:4: ImportWarning: Not importing directory 'pytest_httpbin/certs': missing __init__.py
  from . import serve, certs
============================= test session starts ==============================
platform linux2 -- Python 2.7.14+, pytest-3.2.1, py-1.4.34, pluggy-0.4.0 -- /usr/bin/python2.7
cachedir: .cache
rootdir: /tmp/autopkgtest.ge1fix/build.OUu/pytest-httpbin-0.3.0, inifile:
plugins: httpbin-0.3.0
collecting ... collected 19 items

tests/test_httpbin.py::test_httpbin_gets_injected PASSED
tests/test_httpbin.py::test_httpbin_accepts_get_requests PASSED
tests/test_httpbin.py::test_httpbin_secure_accepts_get_requests PASSED
tests/test_httpbin.py::test_httpbin_secure_accepts_lots_of_get_requests PASSED
tests/test_httpbin.py::test_httpbin_accepts_lots_of_get_requests_in_single_session PASSED
tests/test_httpbin.py::test_httpbin_both[http] PASSED
tests/test_httpbin.py::test_chunked_encoding[http] PASSED
tests/test_httpbin.py::test_httpbin_both[https] PASSED
tests/test_httpbin.py::test_chunked_encoding[https] PASSED
tests/test_httpbin.py::test_httpbin_join PASSED
tests/test_httpbin.py::test_httpbin_str PASSED
tests/test_httpbin.py::TestClassBassedTests::test_http PASSED
tests/test_httpbin.py::TestClassBassedTests::test_http_secure PASSED
tests/test_server.py::test_content_type_header_not_automatically_added PASSED
tests/test_server.py::test_unicode_data FAILED

=================================== FAILURES ===================================
______________________________ test_unicode_data _______________________________

self = <CallInfo when='call' exception: seek() called during concurrent operation on the same file object>
func = <function <lambda> at 0x7f81adc0df50>, when = 'call'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

/usr/lib/python2.7/dist-packages/_pytest/runner.py:196: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python2.7/dist-packages/_pytest/runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
/usr/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
/usr/lib/python2.7/dist-packages/_pytest/capture.py:139: in pytest_runtest_call
    self.suspendcapture_item(item, "call")
/usr/lib/python2.7/dist-packages/_pytest/capture.py:156: in suspendcapture_item
    out, err = self.suspendcapture(in_=in_)
/usr/lib/python2.7/dist-packages/_pytest/capture.py:97: in suspendcapture
    outerr = cap.readouterr()
/usr/lib/python2.7/dist-packages/_pytest/capture.py:327: in readouterr
    self.err.snap() if self.err is not None else "")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <FDCapture 2 oldfd=6>

    def snap(self):
        f = self.tmpfile
>       f.seek(0)
E       IOError: seek() called during concurrent operation on the same file object

/usr/lib/python2.7/dist-packages/_pytest/capture.py:375: IOError
--------------------------- Captured stderr teardown ---------------------------
127.0.0.1 - - [23/Jan/2018 16:13:00] "POST /post HTTP/1.1" 200 477

As you can see, we use pytest version 3.2.1.

Can you help me to understand where the unsafe "seek" comes from? My guess is that there is an error during the test, and that when pytest tries to capture the stderr, it does a seek but fails as stderr has been closed or something else. So my goal would be to get rid of this error and understand then what is actually not going well?

Thanks!

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jan 23, 2018
@nicoddemus
Copy link
Member

Seems similar to #2370, at least the symptom. Can you try passing -s to pytest to see if the problem goes away?

@P-EB
Copy link
Author

P-EB commented Jan 24, 2018

I'll give it a try.

Thanks

@P-EB
Copy link
Author

P-EB commented Jan 24, 2018

I'll have to run the packaging multiple times as it's non-deterministic, maybe it'll take a while.

Sorry for the randomness. :(

@P-EB
Copy link
Author

P-EB commented Jan 24, 2018

16 builds passed without any error.

What are the cons of the -s option if any?

@nicoddemus
Copy link
Member

-s only disables stdout/stderr capturing, the only downside is that print() and writes to stdout/stderr will appear in the middle of the test run, nothing critical really.

@P-EB
Copy link
Author

P-EB commented Jan 24, 2018

That's fine with me. I think you solved all my issues. Thanks!

I'll leave it open for a little while (let's say a week), and come back at you if I see anything relevant.

Cheers!

@P-EB
Copy link
Author

P-EB commented Jan 24, 2018

@nicoddemus maybe you should remove the bug tag? :)

@nicoddemus nicoddemus added type: question general question, might be closed after 2 weeks of inactivity and removed type: bug problem that needs to be addressed labels Jan 24, 2018
@nicoddemus
Copy link
Member

I'll leave it open for a little while (let's say a week), and come back at you if I see anything relevant.

If you don't mind I will close this for now, and we can re-open if you see anything relevant that demands some action on pytest's side. 👍

maybe you should remove the bug tag? :)

Yep thanks 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants